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
curl -u <username_here> https://api.github.com/user/repos -d '{"name":"curltest", "description": "testing description"}' | |
=> Enter passphrase: | |
// Example test case(below): | |
cd <local_repo_dir_path> | |
mkdir curltest | |
cd curltest | |
git init | |
touch curltest.txt | |
subl& culrtest.txt |
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
curl -u <username_here> https://api.bitbucket.org/1.0/repositories/<username_here>/<repo_slug> -X DELETE |
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
curl -X POST -u <username_here> https://api.bitbucket.org/1.0/repositories -d "name=repo_example&description=testing+description&is_private=true&scm=git" --verbose | |
=> Enter passphrase: |
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
require 'haml' unless defined?(Haml) | |
module Haml::Helpers | |
def slugify(str) | |
str.sub(/[^\w]+/,'-').downcase | |
end | |
# Usage in haml document: | |
# = doc_root 6..10, :class => 'no-js', :lang => "en" |
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 bash | |
function gitsetup { | |
# Collect parameters | |
local params=() | |
while [[ $# -gt 0 ]]; do | |
case "${1}" in | |
-h|-\?|--help) | |
echo "Usage: gitsetup -H bitbucket -u username -d 'A description' -t repo_title" |
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 | |
require 'yaml' | |
# Load _config.yaml file | |
Conf = YAML.load_file File.join(Dir.pwd, 'rake_config.yaml') | |
# Paths | |
ROOT = Conf['root'] == '/' ? File.expand_path(File.dirname(__FILE__)) : Conf['root'] | |
SRC_DIR = File.join ROOT, (Conf['source'] || 'src') |
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
# Config | |
root = File.expand_path(File.dirname(__FILE__)) | |
input, output = %w{src site} | |
haml_ext = "\.haml" | |
all_on_start = true | |
# Validate | |
unless File.directory?(File.join(root, input)) | |
abort('No source directory found, cannot continue') | |
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
module Colors | |
def colorize(text, color_code) | |
"\033[#{color_code}m#{text}\033[0m" | |
end | |
{ | |
:black => 30, | |
:red => 31, | |
:green => 32, | |
:yellow => 33, |
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
// Algorithm to calculate the Lowest Common Denominator | |
@function gcd($a, $b){ | |
@if $b == 0 { | |
@return $a; | |
} @else { | |
@return gcd($b, $a%$b); | |
} | |
} | |
// Example Use-case: |
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 | |
# To implement extension, run this command in a shell: | |
# $ sass -i -r ./gcd_sass_extension.rb | |
# Or require it in compass config | |
# require './gcd_sass_extension' | |
module Sass::Script::Functions | |
# | |
# Uses the 'greatest common divisor' algorithm to work out if a fraction |
OlderNewer