This file contains hidden or 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
// https://gist.github.com/FranzSkuffka/d9c52982c265d44a1093f218664b6a5f | |
// https://raw.githubusercontent.com/donnut/typescript-ramda/master/ramda.d.ts | |
// https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/lodash/lodash.d.ts | |
declare namespace fp { | |
interface Dictionary<T> { | |
[index: string]: T; | |
} |
This file contains hidden or 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
// Load the given libraries without polluting the global namespace. | |
const libDefs = [ | |
['https://cdn.jsdelivr.net/npm/[email protected]/dist/handlebars.min.js', 'Handlebars'], | |
['https://cdn.jsdelivr.net/npm/[email protected]', 'L'], | |
['https://cdn.jsdelivr.net/npm/[email protected]/dist/lodash.js', '_'], | |
['https://cdn.jsdelivr.net/npm/[email protected]', 'jQuery'], | |
['https://rawgit.com/joaquingatica/713768/raw/126357dd46a0e6aef4a8441a77d1e8e3ae81c0ba/typeface.js', '_typeface_js'] | |
] | |
const i = document.createElement('iframe') |
This file contains hidden or 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 | |
SVN_REPO=mydomain.com/svn-repo/trunk | |
GIT_REPO=SVN_REPO=mydomain.com/git-repo.git | |
# CLONE GIT | |
rm -rf git-downstream | |
git clone $GIT_REPO git-downstream --depth=1 | |
# CLONE SVN | |
rm -rf svn-upstream |
This file contains hidden or 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
.ghx-done { | |
opacity: .4; | |
transition: .3s; | |
} | |
.ghx-done:hover { | |
opacity: 1; | |
} |
This file contains hidden or 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
# deep map obj with function in context | |
deepMap = (obj, f, ctx) -> | |
res = {} | |
for key of obj | |
val = obj[key] | |
if typeof val == 'object' | |
res[key] = deepMap(val, f, ctx) | |
else | |
res[key] = f.call(ctx, val, key) | |
res |
This file contains hidden or 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
/*! | |
* vue-dragula v1.0.3 | |
* (c) 2016 Yichang Liu | |
* Released under the MIT License. | |
*/ | |
(function (global, factory) { | |
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('dragula')) : | |
typeof define === 'function' && define.amd ? define(['dragula'], factory) : | |
(global.vueDragula = factory(global.dragula)); | |
}(this, function (dragula) { 'use strict'; |
This file contains hidden or 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
# based on http://www.paulund.co.uk/smooth-scroll-to-internal-links-with-jquery | |
$ -> | |
$('a[href*=#]:not([href=#])').on 'click.smoothscroll', (e) -> | |
e.preventDefault() | |
target = @hash | |
$target = $(target) |
This file contains hidden or 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
// inspect an object | |
mixin inspect(data, indentDepth) | |
- indentDepth = typeof indentDepth != "undefined" ? indentDepth : 2 // default indentDepth = 2 | |
pre=JSON.stringify(data, null, indentDepth) |
This file contains hidden or 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
# a function that takes a function and returns a function | |
reduce = (operation) -> | |
# the returned function accepts a list | |
(list) -> | |
# and applies the operation passed to the outer function recursively to the list | |
if list.length > 2 | |
return operation list[0], reduce(operation)(list.slice(1, list.length)) | |
# until it is empty | |
else | |
return operation list[0], list[1] |
This file contains hidden or 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
it 'should support dynamic attributes', -> | |
c """ | |
div(class=foo).foo&attributes(dynamicAttributes) | |
""" , '<div<?php attrs(array("class" => $foo, "class" => "foo"), $dynamicAttributes); ?>></div>' |