Skip to content

Instantly share code, notes, and snippets.

View gnarf's full-sized avatar

Mx Corey Frang gnarf

View GitHub Profile
@gnarf
gnarf / 1-file.txt
Last active August 29, 2015 14:11 — forked from cowboy/1-file.txt
foo bar
baz
qux
last line (there may or may not be a trailing newline after this line)
exports.up = function (knex) {
return knex.schema.createTable('list', function (t) {
t.increments('id');
t.integer('owner_id').notNullable();
t.text('name').notNullable();
t.timestamp('last_modified');
});
};
exports.down = function (knex) {
diff --git a/apps/sms/js/recipients.js b/apps/sms/js/recipients.js
index c5803d0..5e377c8 100644
--- a/apps/sms/js/recipients.js
+++ b/apps/sms/js/recipients.js
@@ -963,7 +963,11 @@
var dialogBody = document.createDocumentFragment();
if (recipient.type) {
var typeElement = document.createElement('span');
- navigator.mozL10n.localize(typeElement, recipient.type);
+ if (!navigator.mozL10n.get(recipient.type)) {
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@gnarf
gnarf / jquery deferred api calls.js
Created October 31, 2012 19:54 — forked from fission6/jquery deferred api calls
complex use case for API calls utilizing jQuery deferreds
// outer IIFE - gives us $ === jQuery!, also, makes every var/function inside "private"!
window.MYAPI = (function($) {
function processSiteRequest( data ) {
var sites = data.response.sites;
// loop through each site given back for the paginated result set
$.each( sites || [], function(index, site) {
debugPrint("Site: " + site.name);
@gnarf
gnarf / gitvars.sh
Created July 5, 2012 19:59
bash script to copy author and hash from current commit
gitvars() {
export author="$(git log --format='%an <%ae>' HEAD -n1)"
export hash="$(git log --format='%H' HEAD -n1)"
echo "\$author=\"$author\""
echo "\$hash=\"$hash\""
}
@gnarf
gnarf / simpleSlideshow.js
Created July 2, 2012 07:42
Just a slideshow I hacked out for someone a year or two ago
/*! simple slideshow example
* gnarf
* This work is licensed under a Creative Commons Attribution 3.0 Unported License
* http://creativecommons.org/licenses/by/3.0/
*/
(function($) {
$(function() {
var timeout,
ss = $(".slideshow"),
images = ss.find("li"),
@gnarf
gnarf / main.js
Created April 28, 2012 15:48 — forked from wilornel/main.php
$(document).ready(function(){
function stopprop( event ) { event.stopPropagation(); }
function starhover( event ) {
console.log( event.type );
this.src = ( event.type === "mouseenter" ) ? 'images/stardown.png' : 'images/starup.png';
}
$('#leftTab').on({
// When hovered
//based on https://gist.github.com/07a297472f182f7a7132/79d3dea1e3dc7ce2d065a42316b83ec820671634
;(function($, undefined) {
$.notify = function(options) {
if(options.timeOut > 0)
{
//add the timer to the message
console.log($(options.message).find('.countDown'));
if($(options.message).find('.countDown').length > 0){
@gnarf
gnarf / deferreds_pipe
Created October 13, 2011 17:53 — forked from dmethvin/deferreds_pipe
Use of deferreds and pipe
fetchCurrentPosition()
.then(updateLocationDisplay)
.pipe(fetchWeatherAtThisLocation)
.then(updateWeatherDisplay)
.pipe(determineWeatherType)
.then(updateRecommendations)
.then(updateAppTile);
function fetchCurrentPosition()
{