Skip to content

Instantly share code, notes, and snippets.

View alkos333's full-sized avatar

Alex Lysenka alkos333

  • Ipswich, MA
View GitHub Profile
@alkos333
alkos333 / gist:1503497
Created December 20, 2011 22:04
Sass parse error when assigning a varable
/usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/repl.rb:38:in `parse_input': undefined method `size' for nil:NilClass (NoMethodError)
from /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/repl.rb:27:in `block in run'
from /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/repl.rb:19:in `loop'
from /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/repl.rb:19:in `run'
from /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/exec.rb:353:in `interactive'
from /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/exec.rb:301:in `process_result'
from /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/exec.rb:41:in `parse'
from /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/exec.rb:21:in `parse!'
from /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.12/bin/sass:8:in `<top (required)>'
from /usr/bin/sass:19:in `load'
@alkos333
alkos333 / hanoi.js
Created January 30, 2012 01:46
Towers of Hanoi (Recursive)
#!/usr/bin/env node
var hanoi = function(disc, src, tmp, dst){
if(disc > 0){
hanoi(disc - 1, src, dst, tmp);
console.log(disc + " " + src + "->" + dst);
hanoi(disc - 1, tmp, src, dst);
}
}
@alkos333
alkos333 / xcode-cli-tools.sh
Last active February 20, 2019 03:22 — forked from rtrouton/gist:f92f263414aaeb946e54
Install Xcode command line tools on 10.7.x - 10.10.x. Tested on 10.7.5, 10.8.5, 10.9.5 and 10.10.2.
#!/bin/bash
# Installing the Xcode command line tools on 10.7.x or higher
osx_vers=$(sw_vers -productVersion | awk -F "." '{print $2}')
cmd_line_tools_temp_file="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
# Installing the latest Xcode command line tools on 10.9.x or higher
if [[ "$osx_vers" -ge 9 ]]; then
# Recursively add a .gitignore file to all directories
# in the working directory which are empty and don't
# start with a dot. Helpful for tracking empty dirs
# in a git repository.
find . -type d -regex ``./[^.].*'' -empty -exec touch {}"/.gitignore" \;
@alkos333
alkos333 / gist:1771618
Created February 8, 2012 17:52
Read URL GET variable
// Given a query string "?to=email&why=because&first=John&Last=smith"
// getUrlVar("to") will return "email"
// getUrlVar("last") will return "smith"
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
}