Skip to content

Instantly share code, notes, and snippets.

@tomvdv
tomvdv / Char to UTF-16
Created November 2, 2012 10:46
Convert characters for comparison
function string_as_unicode_escape(input) {
var output = '';
for (var i = 0, l = input.length; i < l; i++)
output += '\\u' + (input.charCodeAt(i) + 0x10000).toString(16).slice(1);
return output;
}
document.write(string_as_unicode_escape('abcd'));​
@tomvdv
tomvdv / codekit2_lazy-commit.sh
Last active July 27, 2016 20:18
CodeKit 2 hook: auto-commit changes to local git repo
# terminal-notifier available at https://github.com/alloy/terminal-notifier
PROJECT_PATH="/Users/username/Path/To/Project/"
GITFILE="$PROJECT_PATH.git"
if [ ! -e $GITFILE ]
then
cd $PROJECT_PATH && git init && git add . && git commit -m 'initial commit'
terminal-notifier -message "Created local git repo with initial commit" -title "CodeKit hook: git"
else
@mixin mq($point) {
@if $point == xsmall-up {
@media (min-width: 420px) { @content; }
}
@else if $point == small-up {
@media (min-width: 768px) { @content; }
}
@else if $point == medium-up {
@media (min-width: 1024px) { @content; }
}