text:
<repo_name>viktor998/vue-email-list<file_sep>/jquery/assets/css/master.css
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#root{
    display: flex;
    width: 100vw;
    height: 100vh;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.block-mails{
    width: 70%;
    height: 60%;
    border: 1px solid black;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-y: scroll;
}

.block-mails span{
    position: relative;
    padding-top: 10px;
}

button{
    margin: 20px;
    padding: 5px;
    background-color: transparent;
    border: 1px solid black;
    border-radius: 10px;
}

button:hover{
    background-color: rgb(0, 195, 255);
}

button:focus{
    outline: 0
}<file_sep>/jquery/assets/js/main.js
function randMail(){
    $.ajax({
        url: "https://flynn.boolean.careers/exercises/api/random/mail",
        method: 'GET',
        success: function(data){
            $("#block").append(`<span>${data.response}<span>`)

            console.log((`<span>${data.response}<span>`))
        },
        error: function(richiesta, stato, errori){
            alert("ERRORE"+ errori)
        }
    })
}

$('#btn').click(function(){
    for (let i = 0; i < 10; i++) {
        randMail()

    }
})

branch_name: refs/heads/master

languages: JavaScript CSS

repo_language: JavaScript


text:
<repo_name>KugelbergDK/Fonetisk-alfabet<file_sep>/index.py
#!/usr/bin/env python3

fonetisk = {
	"A": "Alfa",		"B": "Bravo",		"C": "Charlie",
	"D": "Delta",		"E": "Echo",		"F": "Foxtrot",
	"G": "Golf",		"H": "Hotel",		"I": "India",
	"J": "Juliett",		"K": "Kilo",		"L": "Lima",
	"M": "Mike",		"N": "November",	"O": "Oscar",
	"P": "Papa",		"Q": "Quebec",		"R": "Romeo",
	"S": "Sierra",		"T": "Tango",		"U": "Uniform",
	"V": "Victor",		"W": "Whiskey",		"X": "Xray",
	"Y": "Yankee",		"Z": "Zulu",		"Æ": "Ægir",
	"Ø": "Ødis",		"Å": "Åse",			"1": "1",
	"2": "2",			"3": "3",			"4": "4",
	"5": "5",			"6": "6",			"7": "7",
	"8": "8",			"9": "9",			"0": "0",
	".": "."
}

choice = ""
print ("Indtast 'QUIT' for at afslutte. \n")
while True:
	choice = input("Vælg bogstav: ").upper()
	if choice == "QUIT":
		break
	if len(choice) == 1:
		print (fonetisk[choice])
	if len(choice) >= 2:
		for letter in choice:
			print (fonetisk[letter] +  " ", end=' ')
		print ("\n")

repo_language: Python

repo_name: KugelbergDK/Fonetisk-alfabet


text:
<file_sep>#version 450 core

#pragma debug(on)

#pragma optimize(off)

const int MAX_LIGHT_SOURCES = 10;

const float PI = 3.14159265359;

struct LightSource{

	vec4 position;

	vec4 ambient;

	vec4 diffuse;

	vec4 specular;

	vec4 spotDirection;

	float spotAngle;

	float spotExponent;

	float kc;

	float ki;

	float kq;

	bool transform;

	bool on;

};

struct LightModel {

	bool localViewer;

	bool twoSided;

	bool useObjectSpace;

	bool celShading;

	vec4 globalAmbience;

	bool colorMaterial;

};

struct Material{

	vec4 emission;

	vec4 ambient;

	vec4 diffuse;

	vec4 specular;

	float shininess;

	int diffuseMat;

	int specularMat;

	int ambientMat;

	int bumpMap;

};

uniform LightSource light[MAX_LIGHT_SOURCES];

uniform LightModel lightModel;

uniform Material material[2];

out VERTEX {

	smooth vec3 position;

	smooth vec3 normal;

	smooth vec3 tangent;

    smooth vec3 bitangent;

	smooth vec2 texCoord;

	smooth vec4 color;

	smooth vec3 eyes;

	smooth vec4 lightDirection[MAX_LIGHT_SOURCES];

} vertex_out;

uniform mat3 normalMatrix;

uniform bool useObjectSpace;

mat3 OLM;

vec4 getLightDirection(vec4 pos, mat4 M, in LightSource light){

	vec4 direction = vec4(0);

	if(light.position.w == 0){	// directional light

		if(light.transform){

			direction = M * light.position;

		}

		direction = light.position;

	}

	else{	// positional light

		vec4 lightPos = (light.position/light.position.w);

		if(light.transform){

			direction = (M*light.position) - pos;

		}else{

			direction = light.position - pos;

		}

	}

	return normalize(vec4( OLM * direction.xyz, 1.0));

}

void applyLight(mat4 MV, mat4 V, vec3 position, vec3 normal, vec3 tangent, vec3 bitangent){

	vec3 n = normalize(normalMatrix * normal);

	vec3 t = normalize(normalMatrix * tangent);

	vec3 b = normalize(normalMatrix * bitangent);

	vertex_out.normal = normalize(normalMatrix * normal);

	vec4 pos = MV * vec4(position, 1);

	vertex_out.position = pos.xyz;

	OLM = !lightModel.useObjectSpace ? mat3(1) : mat3(t.x, b.x, n.x, t.y, b.y, n.y, t.z, b.z, n.z);

	for(int i = 0; i < light.length(); i++){

		vertex_out.lightDirection[i] = getLightDirection(pos, V, light[i]);

	}

	vertex_out.eyes =  OLM * (lightModel.localViewer ? normalize(-pos.xyz) : vec3(0, 0, 1));

}

layout(location=0) in vec3 position;

layout(location=1) in vec3 normal;

layout(location=2) in vec3 tangent;

layout(location=3) in vec3 bitangent;

layout(location=4) in vec4 color;

layout(location=5) in vec2 uv;

uniform mat4 V;

uniform mat4 MV;

uniform mat4 MVP;

uniform float scale = 0.2;

smooth out vec3 vTexPos;

void main(){

	vTexPos = position * scale;

	applyLight(MV, V, position, normal, tangent, bitangent);

	gl_Position = MVP * vec4(position, 1);

}

<file_sep>#version 450 core

#pragma debug(on)

#pragma optimize(off)

const int MAX_LIGHT_SOURCES = 10;

const float PI = 3.14159265359;

struct LightSource{

	vec4 position;

	vec4 ambient;

	vec4 diffuse;

	vec4 specular;

	vec4 spotDirection;

	float spotAngle;

	float spotExponent;

	float kc;

	float ki;

	float kq;

	bool transform;

	bool on;

};

struct LightModel {

	bool localViewer;

	bool twoSided;

	bool useObjectSpace;

	bool celShading;

	vec4 globalAmbience;

	bool colorMaterial;

};

struct Material{

	vec4 emission;

	vec4 ambient;

	vec4 diffuse;

	vec4 specular;

	float shininess;

	int diffuseMat;

	int specularMat;

	int ambientMat;

	int bumpMap;

};

uniform LightSource light[MAX_LIGHT_SOURCES];

uniform LightModel lightModel;

uniform Material material[2];

in VERTEX{

	smooth vec3 position;

	smooth vec3 normal;

	smooth vec3 tangent;

    smooth vec3 bitangent;

	smooth vec2 texCoord;

	smooth vec4 color;

	smooth vec3 eyes;

	smooth vec4 lightDirection[MAX_LIGHT_SOURCES];

} vertex_in;

layout(binding=3) uniform sampler2D normalMap;

vec4 getAmbience(Material m);

vec4 getDiffuse(Material m);

vec4 diffuseContrib(vec3 L, vec3 N, LightSource light, Material m);

float daf(float dist, LightSource light){

	return 1.0 / (light.kc + light.ki * dist + light.kq * dist * dist);

}

float saf(LightSource light, vec3 lightDirection, mat4 M){

	vec3 l = normalize(lightDirection);

	vec3 d =   normalize(mat3(M) * light.spotDirection.xyz);

	float h = light.spotExponent;

	if(light.spotAngle >= 180) 	return 1.0;

	float _LdotD = dot(-l, d);

	float cos_spotAngle = cos(radians(light.spotAngle));

	if(_LdotD < cos_spotAngle) return 0.0;

	return pow(_LdotD, h);

}

vec4 apply(LightSource light, vec4 direction, Material m, mat4 M){

	if(!light.on) return vec4(0);

	vec3 n = gl_FrontFacing ? normalize(vertex_in.normal) : normalize(-vertex_in.normal);

	vec3 N = lightModel.useObjectSpace ? (2.0 * texture(normalMap, vertex_in.texCoord) - 1.0).xyz : n;

	vec3 L = normalize(direction.xyz);

	float f = m.shininess;

	float _daf = daf(length(L), light);

	float _saf = saf(light, L, M);

	vec4 ambient = light.ambient * m.ambient;

	vec4 diffuse =  diffuseContrib(L, N, light, m);

	vec3 E = normalize(vertex_in.eyes);

	vec3 S = normalize(L + E);	// half way vector between light direction and eyes

	vec4 specular = pow(max(dot(S, N), 0), f) * light.specular * m.specular;

	return  _daf * _saf * ((ambient + diffuse) + specular);

}

vec4 phongLightModel(mat4 M){

	Material m = !lightModel.twoSided ?  material[0] : gl_FrontFacing ? material[0] : material[1];

	vec4 color = m.emission + lightModel.globalAmbience * getAmbience(m);

	for(int i = 0; i < light.length(); i++ )

		color += apply(light[i], vertex_in.lightDirection[i], m, M);

	return color;

}

vec4 getAmbience(Material m){

	return lightModel.colorMaterial ? vertex_in.color : m.ambient;

}

vec4 getDiffuse(Material m){

	return lightModel.colorMaterial ? vertex_in.color : m.diffuse;

}

vec4 diffuseContrib(vec3 L, vec3 N, LightSource light, Material m){

	return  max(dot(L, N), 0)  * light.diffuse * getDiffuse(m);

}

struct LineInfo{

	float width;

	vec4 color;

};

uniform LineInfo line;

uniform bool wireframe;

noperspective in vec3 edgeDistance;

float getLineMixColor(){

	float d = min( min(edgeDistance.x, edgeDistance.y), edgeDistance.z);

	return smoothstep(line.width - 1, line.width + 1, d);

}

#define PI 3.14159265

layout(binding = 0) uniform sampler3D noise;

uniform vec4 sky = vec4(0.3, 0.3, 0.9, 1.0);

uniform vec4 cloud = vec4(1.0);

uniform mat4 V;

uniform float bias = 0;

smooth in vec3 gTexPos;

out vec4 fragColor;

vec4 noiseColor(){

	vec4 oct = texture(noise, gTexPos);

	float sum =  (3 * oct.r + oct.g + oct.b + oct.a - 2)/2;

	sum  = (cos(sum * PI) + 1.0)/2.0;

	float t = clamp(bias + sum, 0, 1);

	return vec4(mix(sky, cloud, t).rgb, 1.0);

}

void main(){

	fragColor = phongLightModel(V) * noiseColor();

	fragColor = wireframe ? mix(line.color, fragColor, getLineMixColor()) : fragColor;

}

<file_sep>#version 450 core
#pragma debug(on)
#pragma optimize(off)

#pragma include("constants.glsl")
#pragma include("vertex_in_array.glsl")
#pragma include("vertex_out.glsl")
#pragma include("wireframe_geom.glsl")

layout( triangles ) in;
layout( triangle_strip, max_vertices = 3) out;

smooth in vec3 vTexPos[];
smooth out vec3 gTexPos;

void transferVertexData(int i){
	vertex_out.position = vertex_in[i].position;
	vertex_out.normal = vertex_in[i].normal;
	vertex_out.texCoord = vertex_in[i].texCoord;
	vertex_out.eyes = vertex_in[i].eyes;
	vertex_out.color = vertex_in[i].color;
	gTexPos = vTexPos[i];
	gl_Position = gl_in[i].gl_Position;

	for(int j = 0; j < MAX_LIGHT_SOURCES; j++){
		vertex_out.lightDirection[j] = vertex_in[i].lightDirection[j];
	}
}

void main(){
	float ha, hb, hc;
	calculateWireframe(ha, hb, hc);

	edgeDistance = vec3(ha, 0, 0);
	transferVertexData(0);
	EmitVertex();

	edgeDistance = vec3(0, hb, 0);
	transferVertexData(1);
	EmitVertex();

	edgeDistance = vec3(0, 0, hc);
	transferVertexData(2);
	EmitVertex();
}
<file_sep>#version 450 core

#pragma debug(on)

#pragma optimize(off)

const int MAX_LIGHT_SOURCES = 10;

const float PI = 3.14159265359;

in VERTEX{

	smooth vec3 position;

	smooth vec3 normal;

	smooth vec3 tangent;

    smooth vec3 bitangent;

	smooth vec2 texCoord;

	smooth vec4 color;

	smooth vec3 eyes;

	smooth vec4 lightDirection[MAX_LIGHT_SOURCES];

} vertex_in[];

out VERTEX {

	smooth vec3 position;

	smooth vec3 normal;

	smooth vec3 tangent;

    smooth vec3 bitangent;

	smooth vec2 texCoord;

	smooth vec4 color;

	smooth vec3 eyes;

	smooth vec4 lightDirection[MAX_LIGHT_SOURCES];

} vertex_out;

noperspective out vec3 edgeDistance;

uniform mat4 viewport;

void calculateWireframe(out float ha, out float hb, out float hc){

	vec3 p0 = (viewport * (gl_in[0].gl_Position / gl_in[0].gl_Position.w)).xyz;

	vec3 p1 = (viewport * (gl_in[1].gl_Position / gl_in[1].gl_Position.w)).xyz;

	vec3 p2 = (viewport * (gl_in[2].gl_Position / gl_in[2].gl_Position.w)).xyz;

	// find the altitudes (ha, hb, hc)

	float a = distance(p1, p2);

	float b = distance(p2, p0);

	float c = distance(p1, p0);

	float alpha = acos((b*b + c*c - a*a) / (2.0*b*c));

	float beta = acos((a*a + c*c - b*b) / (2.0*a*c));

	ha = abs( c * sin(beta));

	hb = abs( c * sin(alpha));

	hc = abs(b * sin(alpha));

}

layout( triangles ) in;

layout( triangle_strip, max_vertices = 3) out;

smooth in vec3 vTexPos[];

smooth out vec3 gTexPos;

void transferVertexData(int i){

	vertex_out.position = vertex_in[i].position;

	vertex_out.normal = vertex_in[i].normal;

	vertex_out.texCoord = vertex_in[i].texCoord;

	vertex_out.eyes = vertex_in[i].eyes;

	vertex_out.color = vertex_in[i].color;

	gTexPos = vTexPos[i];

	gl_Position = gl_in[i].gl_Position;

	for(int j = 0; j < MAX_LIGHT_SOURCES; j++){

		vertex_out.lightDirection[j] = vertex_in[i].lightDirection[j];

	}

}

void main(){

	float ha, hb, hc;

	calculateWireframe(ha, hb, hc);

	edgeDistance = vec3(ha, 0, 0);

	transferVertexData(0);

	EmitVertex();

	edgeDistance = vec3(0, hb, 0);

	transferVertexData(1);

	EmitVertex();

	edgeDistance = vec3(0, 0, hc);

	transferVertexData(2);

	EmitVertex();

}

<file_sep>#version 450 core
#pragma debug(on)
#pragma optimize(off)

#pragma include("lighting.frag.glsl")
#pragma include("ads_diffuse.glsl")
#pragma include("wireframe.glsl")

#define PI 3.14159265

layout(binding = 0) uniform sampler3D noise;

uniform vec4 sky = vec4(0.3, 0.3, 0.9, 1.0);
uniform vec4 cloud = vec4(1.0);
uniform mat4 V;
uniform float bias = 0;

smooth in vec3 gTexPos;
out vec4 fragColor;

vec4 noiseColor(){
	vec4 oct = texture(noise, gTexPos);
	float sum =  (3 * oct.r + oct.g + oct.b + oct.a - 2)/2;
	sum  = (cos(sum * PI) + 1.0)/2.0;
	float t = clamp(bias + sum, 0, 1);
	return vec4(mix(sky, cloud, t).rgb, 1.0);
}

void main(){
	fragColor = phongLightModel(V) * noiseColor();
	fragColor = wireframe ? mix(line.color, fragColor, getLineMixColor()) : fragColor;
}
<file_sep>#pragma once

#include <ncl/gl/Scene.h>
#include <ncl/gl/textures.h>
#include <ncl/gl/Camera2.h>

using namespace std;
using namespace glm;
using namespace ncl::gl;

const string parent = "..\\shaders\\";
const string vertex_shader_loc = parent + "shader.vert";
const string fragment_shader_loc = parent + "shader.frag";

struct {
	float pos[4] = { 1, 0.f, 0.f, 1 };
	float diff[4] = { 1, 1, 1, 1 };
	float spec[4] = { 1, 1, 1, 1 };
} slight;

class NoiseScene : public Scene {
public:
	NoiseScene() :Scene("Box Scene") {
		angle = 0;
		_useImplictShaderLoad = true;
		_shader.storePreprocessedShaders(true);

	}

	virtual void init() override {

		light[0].on = true;
		light[0].position = { 1.0, 1.25, 1.25f , 1 };
		texture = new NoiseTex3D();
		_shader.sendUniform1ui("noise", texture->id());
		_shader.sendUniform1f("line.width", 0.05);
		_shader.sendUniform4f("line.color", 0, 0, 0, 1);
		_shader.sendUniform1i("wireframe", false);
		_shader.sendUniformMatrix4fv("viewport", 1, GL_FALSE, value_ptr(getViewport()));

		mat4 mat = translate(mat4(1), { 1, -0.5, 0 });
		teapot = new Teapot(10, true, mat);

		Material& m = teapot->material();
		m.ambient = m.diffuse = m.specular = vec4(1);
		m.shininess = 20;
		sphere = new Sphere(0.5, 20, 250);

		cam.view = lookAt({ 1.0, 1.25, 0.5f }, vec3(0), { 0, 1, 0 });
		camera.setMode(Camera2::SPECTATOR);
		camera.lookAt({ 1.0, 1.25, 0.5f }, vec3(0), { 0, 1, 0 });

	}

	virtual void resized() override {
		camera.perspective(60, aspectRatio, 0.3, 100.0f);
		cam.projection = perspective(radians(60.0f), aspectRatio, 0.3f, 100.0f);
	}

	virtual void display() override {
		camera.lookAt({ 1.0, 1.25, 0.5f }, vec3(0), { 0, 1, 0 });
		mat4 mat = mat4(1); // rotate(mat4(1), radians(angle), { 0, 1, 0 });
	//	cam.model = mat;
		_shader.sendComputed(camera, mat);
	//	cam.model = rotate(mat4(1), radians(angle), { 0, 1, 0 });
		teapot->draw(_shader);
		//sphere->draw(shader);
	}

	virtual void update(float dt) override {
		angle += dt * 20;
		if (angle >= 360) angle -= 360;
	}

private:
	NoiseTex3D* texture;
	Teapot* teapot;
	Sphere* sphere;
	Camera2 camera;
	float angle;
};

languages: C++ GLSL

repo_name: ejosiah/NoiseTest