An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| This is gist. | |
| There are many like it, but this one is mine. | |
| It is my life. | |
| I must master it as I must master my life. | |
| Without me gist is useless. | |
| Without gist, I am useless. |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| require 'socket' | |
| require 'thread' | |
| server = TCPServer.open(8080) | |
| HEADER = <<-EOH | |
| HTTP/1.1 200 OK | |
| Content-Type: text/html; charset=ISO-8859-1 | |
| EOH |
| #!/usr/bin/env bash | |
| # | |
| # Wraps curl with a custom-drawn progress bar. Use it just like curl: | |
| # | |
| # $ curl-progress -O http://example.com/file.tar.gz | |
| # $ curl-progress http://example.com/file.tar.gz > file.tar.gz | |
| # | |
| # All arguments to the program are passed directly to curl. Define your | |
| # custom progress bar in the `print_progress` function. | |
| # |
| /* The Grid ---------------------- */ | |
| .lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; } | |
| .lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
| .lt-ie9 .row.large-collapse .column, | |
| .lt-ie9 .row.large-collapse .columns { padding: 0; } | |
| .lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
| .lt-ie9 .row .row.large-collapse { margin: 0; } | |
| .lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; } | |
| .lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; } |
| module Kernel | |
| def int(mid) | |
| meth = instance_method(mid) | |
| define_method(mid) { |*args, &bk| | |
| val = meth.bind(self).call(*args, &bk) | |
| raise TypeError, "#{mid} did not return an Integer" unless val.is_a? Integer | |
| val | |
| } | |
| mid | |
| end |
| // 'map', 'transform', 'select', or 'project' function. Iterate over a list, | |
| // performing a function on each item, and collecting the new items. Each | |
| // function takes an item as a first argument and returns a transformed item. | |
| // You can pass additional arguments to the function too, which is a decent poor | |
| // man's function composition. | |
| // (I didn't call this f-map because the term 'map' is already used in Sass to | |
| // denote a hash or dictionary.) | |
| @function f-apply($func, $list, $args...) { | |
| $new-list: (); | |
| @each $item in $list { |
| require 'haml' | |
| def line_counter(node) | |
| decendants = node.children.map{|n| line_counter(n)} | |
| if node.type == :filter && %w{ javascript erb plain }.include?(node.value[:name]) | |
| me = node.value[:text].split("\n").length | |
| else | |
| me = 0 | |
| end | |
| sum(decendants) + me |