Skip to content

Instantly share code, notes, and snippets.

View garth's full-sized avatar

Garth Williams garth

View GitHub Profile
@madrobby
madrobby / i18n.coffee
Created November 14, 2011 15:45
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
#
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
#
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')
@wagenet
wagenet / Assetfile.rb
Created January 13, 2012 20:37
Ember Handlebars Precompile
require 'execjs'
class HandlebarsFilter < Filter
class << self
def contents
@@contents ||= [File.read("headless-ember.js"), File.read("ember.js")].join("\n")
end
def context
@@context ||= ExecJS.compile(contents)
@gre
gre / easing.js
Last active April 13, 2025 15:13
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {

Routing in Ember

In Ember, the application's state manager handles routing. Let's take a look at a simple example:

App.stateManager = Ember.StateManager.create({
  start: Ember.State.extend({
    index: Ember.State.extend({
      route: "/",
@phoob
phoob / checkpoint.sh
Last active January 1, 2024 19:55 — forked from bubenkoff/checkpoint.sh
The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just from time to time.
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
#
# Usage: ./checkpoint.sh
#
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script.
@guidoism
guidoism / gist:523fd22f5e306042e01e4a906e03999b
Created September 6, 2022 22:39
Ergogen footprints people have made that aren't in the main repo
https://github.com/50an6xy06r6n/ergogen/blob/master/src/footprints/promicro_rev_routed.js
https://github.com/50an6xy06r6n/ergogen/blob/master/src/footprints/trrs_rev.js
https://github.com/AndrewCloete/ergogen/blob/master/src/footprints/airwire.js
https://github.com/AndrewCloete/ergogen/blob/master/src/footprints/b3u1000p.js
https://github.com/AndrewCloete/ergogen/blob/master/src/footprints/bat.js
https://github.com/AndrewCloete/ergogen/blob/master/src/footprints/frankendiode.js
https://github.com/AndrewCloete/ergogen/blob/master/src/footprints/offsetfrankendiode.js
https://github.com/AndrewCloete/ergogen/blob/master/src/footprints/pcm12.js
https://github.com/AndrewCloete/ergogen/blob/master/src/footprints/promicro_pretty.js
https://github.com/AndrewCloete/ergogen/blob/master/src/footprints/thru.js