Skip to content

Instantly share code, notes, and snippets.

View rhmoller's full-sized avatar

Rene Hangstrup Møller rhmoller

View GitHub Profile
@pom-pom
pom-pom / font-awesome-form-elements.css
Last active January 8, 2024 01:52
Font Awesome Radio Buttons and Checkboxes
/*Custom Radio Buttons and Checkboxes using Font Awesome*/
input[type=radio],
input[type='checkbox'] {
display: none;
}
input[type=radio] + label {
display: block;
}
input[type='checkbox'] + label:before,
@staltz
staltz / introrx.md
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing
'use strict';
var gulp = require('gulp'),
gutil = require('gulp-util'),
tslint = require('gulp-tslint'),
typescript = require('gulp-tsc'),
watch = require('gulp-watch'),
plumber = require('gulp-plumber'),
//livereloadEmbed = require('gulp-embedlr'),
@santthosh
santthosh / apache rewrite rule
Created November 14, 2014 08:38
Apache config for SPA's
# To be inside the /Directory
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
@sephirot47
sephirot47 / GLSL Raymarch ShaderToy tutorial and example code
Created June 29, 2015 12:28
GLSL Raymarch ShaderToy tutorial and example code
/*
a shader executes per pixel
so every thing you see here is he function for every pixel
raymarching is in principe a function that finds the closest point to any surface in the world
then we move our point by that distance and use the same function,
the function will probably be closer to an object in the world every time
and after about 40 to 200 iterations you'll either have found an object or
missed them all into infinity
@ivasilov
ivasilov / gulpfile.js
Created August 14, 2015 13:51
Gulpfile with webpack, typescript and nodemon
var gulp = require("gulp");
var gutil = require("gulp-util");
var rename = require('gulp-rename');
var webpack = require("webpack");
var nodemon = require('nodemon');
var typescript = require('gulp-typescript');
// These tasks setup nodemon.
gulp.task("start", function(cb) {
var options = {
@paullewis
paullewis / requestIdleCallback.js
Last active June 11, 2024 21:10
Shims rIC in case a browser doesn't support it.
/*!
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@Elrashid
Elrashid / gulpfile.js
Created January 10, 2016 14:24
angular2 gulp watch browserSync
/// <binding AfterBuild='build' Clean='clean' />
"use strict";
var path = require('path');
var gulp = require('gulp');
var del = require('del');
var typescript = require('gulp-typescript');
var inlineNg2Template = require('gulp-inline-ng2-template');
var sourcemaps = require('gulp-sourcemaps');
@xem
xem / readme.md
Last active July 14, 2024 10:15
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;