Skip to content

Instantly share code, notes, and snippets.

View yckart's full-sized avatar

Yannick Albert yckart

View GitHub Profile
@gre
gre / easing.js
Last active April 16, 2024 19:53
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* 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 = {
@iambibhas
iambibhas / scopes.txt
Last active April 8, 2024 20:37
Sublime Text 2: Snippet scopes
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
@hamaluik
hamaluik / AABB.hx
Created October 6, 2014 05:38
Continuous collision detection between two moving AABBs using Minkowski differences.
package ;
import openfl.display.Sprite;
/**
* ...
* @author Kenton Hamaluik
*/
class AABB
{
public var center:Vector = new Vector();
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@kevinSuttle
kevinSuttle / meta-tags.md
Last active March 31, 2024 14:26 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@tjlytle
tjlytle / imageColor.php
Created November 17, 2009 19:19
Class to find 'average' image color.
<?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.
@lgarron
lgarron / copyToClipboard.html
Last active December 20, 2023 12:53
Simple `navigator.clipboard.writeText()` polyfill.
<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) {
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
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
@cvengros
cvengros / gist:b2a7e82f66519d423b6f
Created November 15, 2014 01:30
Download directory from GitHub through API
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:
@pascalduez
pascalduez / SassMeister-input.scss
Last active September 22, 2022 08:05
Deep nested values in Sass maps
// ----
// 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