Skip to content

Instantly share code, notes, and snippets.

@AshCoolman
AshCoolman / index.html
Created July 30, 2014 15:16
A Pen by Ashley Coleman.
<ol>
<li>
<span>A long sentence must be hidden</span>
<span>that must be inline-block</span>
</li>
<li>
<span>Cras dignissim cursus nibh. Curabitur.</span>
<span>In hac habitasse platea dictumst.</span>
</li>
</ol>
//http://biostall.com/javascript-new-date-returning-nan-in-ie-or-invalid-date-in-safari
var d = new Date(2011, 01, 07); // yyyy, mm-1, dd
var d = new Date(2011, 01, 07, 11, 05, 00); // yyyy, mm-1, dd, hh, mm, ss
var d = new Date("02/07/2011"); // "mm/dd/yyyy"
var d = new Date("02/07/2011 11:05:00"); // "mm/dd/yyyy hh:mm:ss"
var d = new Date(1297076700000); // milliseconds
var d = new Date("Mon Feb 07 2011 11:05:00 GMT"); // ""Day Mon dd yyyy hh:mm:ss GMT/UTC
git clone $1 unique_local_name
cd unique_local_name
for remote in `git branch -r | grep -v master `; \
do git checkout --track $remote ; done
git remote add neworigin $2
git push --all neworigin
git push --tags neworigin
@AshCoolman
AshCoolman / tell_slack.sh
Last active August 26, 2015 12:33
Tell slack when your AWS instance has restarted
# Tell slack when your AWS instance has restarted
#
# 1. Replace the slack service hook (or entire script from `curl -X POST...`)
# 2. Put this file in your .ebextensions folder called tell_slack.config
#
# .ebextensions/
# └── tell_slack.config
#
# On your deployed server tell_slack.sh should be AUTOMATICALLY generated in /opt/elasticbeanstalk/hooks/appdeploy/post
#
@AshCoolman
AshCoolman / tell_slack_last_x_commits.sh
Last active September 8, 2015 09:52
Tell (Slack) webhook your last X commits
# Usage:
#
# ```
# $sh tell-slack-git-log.sh 2
# ```
#
# Creates slack message:
# ```
# Changes:
#
@AshCoolman
AshCoolman / New Mac installation guide.md
Last active July 25, 2018 06:24 — forked from DenisIzmaylov/INSTALLATION.md
Fresh OSX install guide for Node development (El Capitan version)
@AshCoolman
AshCoolman / practical-slack-a-5-minute-guide.md
Last active July 12, 2016 13:18
Practical Slack: a 5 minute slack guide (paste in #general)

New to slack?

📣 Slack: The 5 minute guide

This is my quick-enough guide to give you a taste of the slack awesomeness, in a few minutes

Windows users: This is an OSX guide, on Windows replace with Ctrl

Why not just use Skype

@AshCoolman
AshCoolman / angular 1.x module access from non-angular code.js
Last active October 27, 2015 16:36
Angular 1.x module access from non-angular code (e.g. console, react etc)
var getService = function (serviceName) {
return angular.element(document.body).injector().get(serviceName);
}
var getRootScope = function () {
return angular.element(document.body).scope().$root;
}
@AshCoolman
AshCoolman / babel es6 modules.md
Last active November 28, 2015 17:48
Babel 6 es6 modules

Babel 6 es6 modules

Babel 6 was just released! This means that it might take some time for all possible integrations to upgrade. Make sure to check the compatibility of your chosen integration. https://babeljs.io/blog/2015/10/29/6.0.0/

ES6 modules now need the following:

Added to package.json:

The unnoffical Babel 6 Babel 5 style legacy decorator plugin has a slightly different implementation of that actual Babel 5 decorator implementation.

What decorator support does Babel 5 and Babel 6 have?

...the intention is still for Babel 6 to implement the new proposal once it has been officially presented to TC39.

-source: loganfsmyth on Phabricator

So Babel 5 supported the old decorator spec, Babel 6 will support the new decorator spec - when the new spec is settled.