Skip to content

Instantly share code, notes, and snippets.

View 3mcd's full-sized avatar
🦌

Eric McDaniel 3mcd

🦌
View GitHub Profile
@kenjinp
kenjinp / CapsuleBufferGeometry.ts
Last active October 24, 2021 14:41
A threejs capsule geometry! CapulseBufferGeometry: for creating capsules using threejs and typescript. Especially helpful for games
import * as THREE from "three";
import { BufferGeometry } from "three";
/**
* Capsule Geometry
* especially helpful in 3D games
* original creator:
* @author maximequiblier
*
* Modified for typescript (partially)
@oscarduignan
oscarduignan / gist:c79aab79b3ff69b52ee7
Last active July 1, 2016 18:09
Outline of pattern for building stuff with RxJS and React. Originally at http://jsbin.com/jelale/edit?js and mirrored here to make it clearer that it's not currently supposed to be executable!
/*
OUTLINE FOR AN APP BUILT WITH RXJS AND REACT, USING AN ELASTICSEARCH FACETED SEARCH
MODULE AS AN EXAMPLE, READ FROM BOTTOM UP IF YOU WANT TO GO OUTSIDE IN, START FROM
TOP TO SEE HOW THE SEARCH MODULE IS COMPOSED.
If you find this I would love to hear some feedback - it's not designed to work without
any modification though, it's just supposed to outline the architecture off-the-top-of-
my-head-pretty-close-to-working psuedocode of something that you might actually need to
build to drive out if the pattern is any good!
*/
@necolas
necolas / MyComponent.css
Created April 15, 2014 03:22
SUIT CSS spacing with variables
:root {
--margin-MyComponent-part: var(--theme-margin-small);
}
.MyComponent {}
.MyComponent-part {
margin: var(--margin-MyComponent-part);
}
@hara
hara / github.vim
Created July 31, 2013 13:20
github theme of vim-airline
let s:file = [ '#bd2c00' , '#666666' , 1 , 240 , 'bold' ]
" Normal mode
let s:N1 = [ '#ffffff' , '#6cc644' , 255 , 2 ] " mode
let s:N2 = [ '#ffffff' , '#999999' , 255 , 248 ] " info
let s:N3 = [ '#ffffff' , '#666666' , 255 , 240 ] " statusline
let g:airline#themes#github#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file)
let g:airline#themes#github#normal_modified = {
\ 'info_separator': [ '#999999' , '#333333' , 248 , 232 , '' ] ,
@Sebmaster
Sebmaster / client.js
Last active December 16, 2015 15:39
Method to implement data-synchronization in angular.js via racer.js
var module = angular.module('racer.js', [], function ($provide) {
var setImmediate = window && window.setImmediate ? window.setImmediate : function (fn) {
setTimeout(fn, 0);
};
var racer = require('racer');
$provide.factory('racer', ['$http', '$q', '$rootScope', function ($http, $q, $rootScope) {
$http.get('/model').success(function (data) {
racer.init(data);
});
@maxrice
maxrice / us-state-names-abbrevs.php
Created May 23, 2012 18:32
US State Names & Abbreviations as PHP Arrays
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',