Skip to content

Instantly share code, notes, and snippets.

View endel's full-sized avatar

Endel Dreyer endel

View GitHub Profile
@endel
endel / threejs-json-atlas-loader.js
Last active September 13, 2021 13:11 — forked from momo-the-monster/threejsatlasloader.js
three.js - JSON Atlas Loader
// three.js JSON Atlas Loader
// Requires: whatwg-fetch (https://github.com/github/fetch)
var materials = {}
fetch('images/spritesheet.json').then(function(response) {
return response.json()
}).then(function(json) {
var atlasTexture = THREE.ImageUtils.loadTexture('images/' + json.meta.image, undefined, function() {
@endel
endel / Makefile
Created January 28, 2014 14:17 — forked from bpierre/Makefile
# JS files
JS_FINAL = js/project-name-all.js
JS_TARGETS = js/file1.js \
js/file2.js \
js/file3.js
# CSS files
CSS_FINAL = css/project-name-all.css
STYLUS_TARGETS = css/file1.styl \
@endel
endel / time_ago_in_words.js
Last active December 30, 2015 23:39 — forked from sulf/gist:1157909
var distance_of_time_in_words, time_ago_in_words;
time_ago_in_words = function(from_time, include_seconds) {
if (include_seconds != null) {
include_seconds;
} else {
include_seconds = false;
};
return distance_of_time_in_words(from_time, Date.now(), include_seconds);
};
distance_of_time_in_words = function(from_time, to_time, include_seconds) {
@endel
endel / mono.rb
Last active December 26, 2015 22:09 — forked from shtirlic/mono.rb
Install mono-2.11.4 os OSX via homebrew.
# http://www.mono-project.com/Compiling_Mono_on_OSX
require 'formula'
class Mono < Formula
#url 'http://download.mono-project.com/sources/mono/mono-3.0.6.tar.bz2'
#sha1 'e2187f80366fcd65c55a1ab946f8d3b39e81be77'
url 'http://download.mono-project.com/sources/mono/mono-2.11.4.tar.bz2'
sha1 '41707d3b6a1bd8380f4150474602c19e5e88e3f8'
@endel
endel / gist:3623976
Created September 4, 2012 17:40 — forked from emerleite/gist:3621544
Velocity 2012 - Anotações
http://estelle.github.com/mobileperf/#slide55
https://github.com/impressiver/velocity2012
https://github.com/jonlives/velocity_resources
Chef - Jon Cowie (Etsy)
Ele tem um handler que consegue mandar o que falha para or irc usando
@endel
endel / hoptoad.rb
Created September 8, 2011 04:14 — forked from thibaudgg/hoptoad.rb
Custom Goliath Rack middleware for Toadhopper / HoptoadNotifier
require 'toadhopper'
require 'em-synchrony/em-http'
class Toadhopper
def post_document(document, headers={})
uri = URI.parse(@error_url)
begin
response = EM::HttpRequest.new(uri).post({
:body => document,
:head => {'Content-type' => 'text/xml', 'Accept' => 'text/xml, application/xml'}.merge(headers)
@saas_publisher = @saas_publishers.find(params[:id])
@saas_publisher.publisher.update_attributes(params[:saas_publisher].delete(:publisher))
@saas_publisher.update_attributes(params[:saas_publisher])
@endel
endel / redis-server-for-init.d-startup
Created June 16, 2011 03:16 — forked from lsbardel/redis-server-for-init.d-startup
Init.d Redis script for Ubuntu
#!/bin/bash
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
##
# test/spec/mini 3
# http://gist.github.com/25455
# chris@ozmm.org
# file:lib/test/spec/mini.rb
#
def context(*args, &block)
return super unless (name = args.first) && block
require 'test/unit'
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do