Skip to content

Instantly share code, notes, and snippets.


Chris O'Donnell codfish

View GitHub Profile
Yimiprod / difference.js
Last active Aug 13, 2020
Deep diff between two object, using lodash
View difference.js
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
kevinSuttle /
Last active Aug 7, 2020 — forked from lancejpollard/
List of Usable HTML Meta and Link Tags
CatTail / htmlentity.js
Created Nov 30, 2012
Javascript: encode(decode) html text into html entity
View htmlentity.js
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
elidupuis / handlebars-helpers.js
Last active Jul 7, 2020
Simple Handlebars.js helpers
View handlebars-helpers.js
/*! ******************************
Handlebars helpers
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
monkeymonk / jquery.scrollToTop.js
Created Apr 8, 2016
ES6 jQuery plugin definition
View jquery.scrollToTop.js
import $ from 'jquery';
import plugin from './plugin';
class ScrollToTop {
constructor(element, options) {
const $element = $(element);
$(window).scroll(function () {
if ($(this).scrollTop() > options.offset) {
ianmariano / git-fork-sync
Last active Apr 21, 2020
Syncs your repo fork with the upstream master and then pushes the synced master to origin. Presumes you have an 'upstream' remote which is from whence your fork was created. Put on your path and chmod a+x it then do: git fork-sync. Use -h for usage help.
View git-fork-sync
#!/usr/bin/env bash
set -Eeuo pipefail
_usage() {
cat << __EOF
$0 usage:
Joostvanderlaan /
Last active Feb 9, 2020 — forked from codfish/
Prettier + ESLint + airbnb config + Husky + lint-staged + commitlint + markdownlint


  • added steps to fix markdown via cli (extra script)

  • autofix in vs code on save, add this setting:

    "editor.codeActionsOnSave": { "source.fixAll.markdownlint": true }


View Capfile
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Custom tasks
require 'capistrano/composer'
require 'capistrano/npm'
CMCDragonkai / UrlFriendly.Filter.js
Created Aug 21, 2013
JS: Angular Url Friendly Filter. Can be used to create url friendly permalinks from blog titles. Port of url_title in Codeigniter.
View UrlFriendly.Filter.js
define(['angular'], function(angular){
'use strict';
.filter('UrlFriendly', [
return function(text, separator, lowercase){
var output,
ijones922 / gist:5952576
Created Jul 8, 2013
Javascript: equal column heights
View gist:5952576
function matching_heights() {
var highestCol = Math.max($('').height(),$('').height());
You can’t perform that action at this time.