Skip to content

Instantly share code, notes, and snippets.

Simounet / index.html
Created Feb 19, 2012
Simple JS Popin
View index.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simple JS Popin</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="script.js" type="text/javascript"></script>
gabrielstuff /
Last active Nov 15, 2018
The top software install for a new PC on Windows

New windows 10 machine setup

first install bash:

Third, install choco, open in elevation mode the cmd (with administrative rights) and copy paste :

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString(''))" &amp;&amp; SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:

Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
neilmendoza / gist:4512992
Last active Jun 8, 2022
Function to return matrix for rotation about an arbitrary axis in GLSL.
View gist:4512992
mat4 rotationMatrix(vec3 axis, float angle)
axis = normalize(axis);
float s = sin(angle);
float c = cos(angle);
float oc = 1.0 - c;
return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,
oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,
oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,
bfncs / mouse.js
Created Mar 12, 2012
Read Linux mouse(s) in node.js
View mouse.js
* Read Linux mouse(s) in node.js
* Author: Marc Loehe (
* Adapted from Tim Caswell's nice solution to read a linux joystick
var fs = require('fs'),
DamonOehlman /
Last active Sep 20, 2022
General WebRTC tips and tricks collated over time
kylemcdonald / three.js.shader.html
Last active Oct 11, 2022
Minimal three.js shader example.
View three.js.shader.html
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
body {
margin: 0px;
overflow: hidden;
wmcmurray / BasicCustomShader.js
Last active Dec 9, 2022
A basic example of a ThreeJS (r108) ShaderMaterial with shadows, fog and dithering support.
View BasicCustomShader.js
import { mergeUniforms } from 'three/src/renderers/shaders/UniformsUtils.js'
import { UniformsLib } from 'three/src/renderers/shaders/UniformsLib.js'
export default {
uniforms: mergeUniforms([
cvan / webgl-detect-gpu.js
Last active Dec 30, 2022
use JavaScript to detect GPU used from within your browser
View webgl-detect-gpu.js
var canvas = document.createElement('canvas');
var gl;
var debugInfo;
var vendor;
var renderer;
try {
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {