Skip to content

Instantly share code, notes, and snippets.

View kimroen's full-sized avatar

Kim Røen kimroen

View GitHub Profile
@WMeldon
WMeldon / ember.plugin.zsh
Created July 17, 2014 18:56
Ember command completion for (oh-my) ZSH.
# ------------------------------------------------------------------------------
# FILE: ember.plugin.zsh
# DESCRIPTION: oh-my-zsh ember plugin file.
# AUTHOR: Will Meldon ([email protected])
# VERSION: 0.0.1
# ------------------------------------------------------------------------------
# Based (heavily) on composer.plugin.zsh
#
# Ember basic command completion
_ember_get_command_list () {
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 9, 2025 20:46
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@staltz
staltz / introrx.md
Last active May 15, 2025 10:37
The introduction to Reactive Programming you've been missing
app.registry.add('css', 'broccoli-compass', 'scss', {
toTree: function(tree, inputPath, outputPath, options) {
// broccoli-compass doesn't like leading slashes
if (inputPath[0] === '/') { inputPath = inputPath.slice(1); }
tree = mergeTrees([
tree,
'public'
], {
description: 'TreeMerger (stylesAndVendorAndPublic)'
/* Put your CSS here */
html, body {
margin: 20px;
}
.color {
height: 200px;
width: 200px;
}
import Facebook from 'appkit/initializers/facebook';
var FacebookAuthenticator = Ember.SimpleAuth.Authenticators.OAuth2.extend({
authenticate: function() {
var _this = this;
return new Ember.RSVP.Promise(function(resolve, reject) {
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
_this.facebookCallback().then(function(response) {
var expiresAt = _this.absolutizeExpirationTime(response.expires_in);
@brianarn
brianarn / maths.js
Last active January 22, 2025 18:42
Module to wrap `console.group` around all methods
// A simple object with some methods,
// which throw errors when bad arguments are passed.
var maths = {
square : function (value) {
// Validity checking
if (arguments.length !== 1) {
throw new Error('square: Requires one and only one argument');
}
if (typeof value !== 'number') {
throw new Error('square: Requires numeric argument');
@machty
machty / document-title-router.js
Created January 14, 2014 05:12
document.title integration in ember
// Extend Ember.Route to add support for sensible
// document.title integration.
Ember.Route.reopen({
// `titleToken` can either be a static string or a function
// that accepts a model object and returns a string (or array
// of strings if there are multiple tokens).
titleToken: null,
@mbbischoff
mbbischoff / UITextField+LCKHacks.h
Created December 1, 2013 00:22
Used instead of `hasText` due to an inscrutable bug in iOS 7.
#import <UIKit/UIKit.h>
@interface UITextField (LCKHacks)
/// Fixes a bug in UIKit where the `hasText` methods sometimes returns the string's length instead of a BOOL in iOS 7.0.x.
- (BOOL)actuallyHasText;
@end