Skip to content

Instantly share code, notes, and snippets.

View grabcode's full-sized avatar

Alex Girard grabcode

View GitHub Profile
@pamelafox
pamelafox / fancybox.diff
Created March 18, 2012 04:04
Zepto + FancyBox Diffs
diff --git a/application/static/js/libs/jquery.fancybox.js b/application/static/js/libs/jquery.fancybox.js
index be77275..c1d74b7 100755
--- a/application/static/js/libs/jquery.fancybox.js
+++ b/application/static/js/libs/jquery.fancybox.js
@@ -359,7 +359,6 @@
this.style.visibility = 'inherit';
});
}
-
overlay.show();
@Potherca
Potherca / README.md
Last active November 27, 2023 17:44
Create a branch on Github without access to a local git repo using http://hurl.eu/

Ever had the need to create a branch in a repo on Github without wanting (or being able) to access a local repo?

With the aid of [the Github API][1] and any online request app this is a piece of cake!

Just follow these steps:

  1. Open an online request app (like apirequest.io, hurl.it pipedream.com, reqbin.com, or webhook.site)
  2. Find the revision you want to branch from. Either on Github itself or by doing a GET request from Hurl: https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs/heads
  3. Copy the revision hash
  4. Do a POST request from Hurl to https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs with the following as the POST body :
@canuk
canuk / moment.fiscal_year.js
Created February 24, 2014 19:26
Moment.js Fiscal Year Calculations (FY starts in October)
if (moment().quarter() == 4) {
var current_fiscal_year_start = moment().month('October').startOf('month');
var current_fiscal_year_end = moment().add('year', 1).month('September').endOf('month');
var last_fiscal_year_start = moment().subtract('year', 1).month('October').startOf('month');
var last_fiscal_year_end = moment().month('September').endOf('month');
} else {
var current_fiscal_year_start = moment().subtract('year', 1).month('October').startOf('month');
var current_fiscal_year_end = moment().month('September').endOf('month');
var last_fiscal_year_start = moment().subtract('year', 2).month('October').startOf('month');
var last_fiscal_year_end = moment().subtract('year', 1).month('September').endOf('month');
@grabcode
grabcode / _log.js.coffee
Created February 8, 2015 00:38
Isomorphic javascript helper - custom log
root = exports ? this
root._log = ->
args = [new Date()].concat Array.prototype.slice.apply(arguments)
console.log.apply console, args
@imjasonh
imjasonh / markdown.css
Last active May 17, 2024 07:30
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@grabcode
grabcode / snippets.cson
Last active December 28, 2015 03:27
ReactNative Component and Styles Snippet
'.source.js':
'ReactNative Component':
'prefix': 'rnc'
'body': """
'use strict';
import React, {
Text,
} from 'react-native';
@grabcode
grabcode / scope_explorer.js
Last active February 2, 2016 10:38
Explore or Spy the global variables available, or any given scope. By default, it run in the global browser scope `window`, and exclude its default properties.
/*
* Explore/Spy App Global variables, excluding defaults (defaults comes down a scope)
* > Run me in your dev tool console via copy/pasting
* > In return, I provide a list of keys, and copy in your clipboard (how sweet is that!)
*
* Follow my creator https://twitter.com/grabthecode
*/
;(function(scope, defaults){
@mmazzarolo
mmazzarolo / Appfile
Created May 17, 2016 11:27
Simple Fastlane setup for React-Native (Android - iOS)
# iOS
app_identifier "com.myapp.app" # The bundle identifier of your app
apple_id "me@gmail.com" # Your Apple email address
team_id "1234ABCD" # Developer Portal Team ID
# Android
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "com.myapp.app" # Your Android app package
@jesstelford
jesstelford / event-loop.md
Last active May 10, 2024 01:23
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code