This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const minute = 60; | |
const hour = minute * 60; | |
const day = hour * 24; | |
const week = day * 7; | |
const month = day * 30; | |
const year = day * 365; | |
/** | |
* Convert a date to a relative time string, such as | |
* "a minute ago", "in 2 hours", "yesterday", "3 months ago", etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
npmname=$1 | |
destination=/usr/src/npm/$npmname | |
if test -d $destination; then | |
echo "$npmname is already cloned into:" | |
echo " $destination" | |
exit 0 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const markdownIt = require('markdown-it') | |
const frontMatter = require('front-matter') | |
const Prism = require('prismjs') | |
const aliases = { | |
'js': 'jsx', | |
'html': 'markup' | |
} | |
const highlight = (str, lang) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
angular.module('Component', []) | |
.factory('Component', function () { | |
return function(bindings, template, linkFn, options) { | |
var directive = { | |
scope: parseBindings(bindings), | |
template: parseTemplate(template), | |
link: linkFn |
git-prebase improves on 'git rebase -i' by adding information per commit regarding which files it touched.
- Each file gets an alpha-numeric identifier at a particular column, a list of which appears below the commit list. (The identifiers wrap around after the 62nd file)
- Commits can be moved up and down safely (without conflicts) as long as their columns don't clash (they did not touch the same file).
Add the executable to your path and git will automatically expose it as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add this just before your closing </body> tag --> | |
<!-- Replace 'APP_ID' with your app ID --> | |
<script> | |
window.intercomSettings = { app_id: 'APP_ID' }; | |
</script> | |
<!-- Replace 'APP_ID' with your app ID --> | |
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/APP_ID';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class MergedBranchCleanup | |
attr_reader :remote, :branch | |
class << self | |
def run(remote="origin", branch="master") | |
MergedBranchCleanup.new(remote, branch).start | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var anagram = function(word) { | |
return new Anagram(word); | |
}; | |
function Anagram(word) { | |
this.matches = matches; | |
function matches() { | |
possible_anagrams = retrieveAnagrams(arguments); | |
return possible_anagrams.filter(function(anagram) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ignore": [ | |
"**/deps/**", | |
"**/node_modules/**", | |
"**/thirdparty/**", | |
"**/third_party/**", | |
"**/vendor/**", | |
"**/**-min-**", | |
"**/**-min.**", | |
"**/**.min.**", |
NewerOlder