Skip to content

Instantly share code, notes, and snippets.


Alex Girard grabcode

View GitHub Profile
grabcode / ES6-request-json.js
Last active Jul 5, 2017
ES6 fetch syntactic sugar: handling common fetch usage with json content type, same headers, and stringified body
View ES6-request-json.js
fetch is awesome, there's no question about it.
But aren't you tired of:
- Writing your `res => res.json()` handler
- Having to stringify your body
- Signin your request with the same headers (```{'Content-Type': json, Authorization: 'JWT ...'}```)
- Inconsistently handling the response status code and not reject promise when relevant.
jesstelford /
Last active Jan 11, 2021
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

mmazzarolo / Appfile
Created May 17, 2016
Simple Fastlane setup for React-Native (Android - iOS)
View Appfile
# iOS
app_identifier "" # The bundle identifier of your app
apple_id "" # 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 to get one
package_name "" # Your Android app package
grabcode / scope_explorer.js
Last active Feb 2, 2016
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.
View scope_explorer.js
* 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
;(function(scope, defaults){
grabcode / snippets.cson
Last active Dec 28, 2015
ReactNative Component and Styles Snippet
View snippets.cson
'ReactNative Component':
'prefix': 'rnc'
'body': """
'use strict';
import React, {
} from 'react-native';
ImJasonH / markdown.css
Last active Jan 8, 2021
Render Markdown as unrendered Markdown (see
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
grabcode /
Created Feb 8, 2015
Isomorphic javascript helper - custom log
root = exports ? this
root._log = ->
args = [new Date()].concat Array.prototype.slice.apply(arguments)
console.log.apply console, args
canuk / moment.fiscal_year.js
Created Feb 24, 2014
Moment.js Fiscal Year Calculations (FY starts in October)
View moment.fiscal_year.js
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');
Potherca /
Last active Jan 21, 2021
Create a branch on Github without access to a local git repo using

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,,, or
  2. Find the revision you want to branch from. Either on Github itself or by doing a GET request from Hurl:<AUTHOR>/<REPO>/git/refs/heads
  3. Copy the revision hash
  4. Do a POST request from Hurl to<AUTHOR>/<REPO>/git/refs with the following as the POST body :
You can’t perform that action at this time.