Skip to content

Instantly share code, notes, and snippets.

@galfert
galfert / controllers.application.js
Last active December 21, 2018 21:04
required input
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
save: function() {
alert('saving ' + this.get('foo'));
}
}
});
@galfert
galfert / wifi.json
Last active January 12, 2016 23:18 — forked from beanieboi/wifi.json
Hackerbeach Wifi Passwords
{
"places": [
{
"name": "Surf Shak",
"SSID": "Bar Surf",
"password": "shak2525"
},
{
"name": "Hostal Rutamar",
"SSID": "HOSTAL RUTAMAR",
@galfert
galfert / guacamole.md
Last active December 28, 2015 16:59
Guacamole recipe

Guacamole recipe

Ingredients

  • 2 ripe avocados
  • 2 tomatoes (i like to use dryed tomatoes when available)
  • 1/2 clove of garlic
  • 1/2 onion
  • lime juice from half a lime
  • chily and/or cayenne pepper
@galfert
galfert / release_checklist.md
Last active December 27, 2015 22:19
remoteStorage.js release checklist
  • Create changelog since last release
  • Bump version in src/version.js
  • Run npm test
  • Run build all
  • Add build to release dir
  • Tag version in git
  • Publish release on remotestorage.io
  • Publish release on GitHub
  • Publish release on NPM
@galfert
galfert / gist:6476165
Created September 7, 2013 14:44
Geolocation
if ("geolocation" in navigator) {
navigator.geolocation.getCurrentPosition(
function(position) {
console.log(position.coords.latitude, position.coords.longitude);
},
function(error) {
alert(error.message);
}, {
enableHighAccuracy: true,
timeout: 5000
@galfert
galfert / app.js
Last active December 15, 2015 16:49
remoteStorage with Ember.js
// tell the app to not start the router right away when there is an access_token param
if (window.location.hash.match(/#access_token=.+/)) {
App.deferReadiness();
}
remoteStorage.claimAccess({ tasks: 'rw' }).then(function() {
remoteStorage.on('ready', function() {
// now we can start the router
App.advanceReadiness();
});
/* remoteStorage.js 0.7.1 remotestorage.io, MIT-licensed */
/**
* almond 0.1.4 Copyright (c) 2011, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
// a().then(b).then(c).then(function() {
@galfert
galfert / gist:2040501
Created March 14, 2012 23:55
Bash prompt (GIT & RVM)
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
PURPLE="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
[user]
name = Scott Chacon
email = schacon@gmail.com
[alias]
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
unstage = reset HEAD
lol = log --pretty=oneline --abbrev-commit --graph --decorate
branches = !git-branches
st = status
[gui]
// only outputs if console available and does each argument on its own line
function log() {
if (window && window.console && window.console.log) {
var i, len;
for (i=0, len=arguments.length; i<len; i++) {
console.log(arguments[i]);
}
}
}