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 work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License, Version 2, | |
* as published by Sam Hocevar. See the COPYING file for more details. | |
*/ | |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { |
Here is a list of scopes to use in Sublime Text 2 snippets - | |
ActionScript: source.actionscript.2 | |
AppleScript: source.applescript | |
ASP: source.asp | |
Batch FIle: source.dosbatch | |
C#: source.cs | |
C++: source.c++ | |
Clojure: source.clojure | |
CoffeeScript: source.coffee |
package ; | |
import openfl.display.Sprite; | |
/** | |
* ... | |
* @author Kenton Hamaluik | |
*/ | |
class AABB | |
{ | |
public var center:Vector = new Vector(); |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
<?php | |
/** | |
* imageColor | |
* | |
* Shows three methods to find the 'average' image color. | |
* | |
* Each function expects a gd image object. | |
* | |
* imageColor::averageResize($image) resizing to 1px, and checking the color. | |
* imageColor::averageBorder($image) find the average color of all border pixels. |
<script> | |
// A minimal polyfill for copying text to clipboard that works most of the time in most capable browsers. | |
// Note that: | |
// - You may not need this. `navigator.clipboard.writeText()` works directly in all modern browsers as of 2020. | |
// - In Edge, this may call `resolve()` even if copying failed. | |
// - In Safari, this may fail if there is nothing selected on the page. | |
// See https://github.com/lgarron/clipboard-polyfill for a more robust solution. | |
// | |
// License for this Gist: public domain / Unlicense | |
function writeText(str) { |
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
class GitHub | |
class << self | |
def download_file_to_string(github_token, setup={}, raw=true, link=nil) | |
if link | |
url = link | |
else | |
sql_repo_name = setup['repo_name'] | |
sql_repo_owner = setup['repo_owner'] | |
# URI join won't make it: |
// ---- | |
// Sass (v3.3.7) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
// Deep nested values in Sass maps. | |
// Fetch a deep value in a multi-level map. | |
// https://gist.github.com/KittyGiraudel/9933331 |