Skip to content

Instantly share code, notes, and snippets.

View yckart's full-sized avatar

Yannick Albert yckart

View GitHub Profile
@btoone
btoone / curl.md
Last active October 10, 2025 20:21
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
@tsmallfield
tsmallfield / Deferred
Created April 13, 2012 06:05
deferred
/**
* @return {Object.<function>}
*/
function Deferred() {
/*-------------------------------------------
INIT
-------------------------------------------*/
var queue = [];
/*-------------------------------------------
@pamelafox
pamelafox / util.js
Created April 13, 2012 17:44
JavaScript Utility Libraries (Scroll down!)
var ED = ED || {};
// Utility functions
ED.util = (function() {
// Data structure functions
function each(object, callback) {
if (object === null) return;
@abernier
abernier / index.html
Created April 21, 2012 01:05
momentum
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<style>
html, body {height:100%;}
body {
background-color:#269;
background-image: -webkit-linear-gradient(white 2px, transparent 2px),
@max-power
max-power / geolocation_polyfill.js
Created May 3, 2012 06:12
HTML5 Geolocation Polyfill
// requires jquery.js, tested with reqwest.js with jquery compat mode
// uses http://geoplugin.net/json.gp
// lowercase arguments are just string placeholder
// F = Function placeholder
// Z = Cache placeholder
;(function(N,g,c,x,y,u,j,F,Z) {
F=function(s,e){Z?s(Z):$.ajax({url:'//'+u+'.net/'+j+'.gp',dataType:j+'p',jsonp:j+'callback',error:e,success:function(R){Z={};Z[c]={};Z[c][x]=R[u+'_'+x];Z[c][y]=R[u+'_'+y];s(Z)}})}
N[g]=N[g]||{getCurrentPosition:F,watchPosition:F,clearWatch:function(){Z=undefined}}
@Prinzhorn
Prinzhorn / LICENSE.txt
Created May 7, 2012 15:55 — forked from 140bytes/LICENSE.txt
compress hex color string
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Alexander Prinzhorn (@Prinzhorn) https://github.com/Prinzhorn
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsmallfield
tsmallfield / pera1
Created June 9, 2012 13:07
parallax
/**
* @namespace pera1
*/
;(function(win, doc) {
"use strict";
/////////////////////////////////////////////////
/**
@melanke
melanke / MultiGetSet.js
Created June 19, 2012 20:53
MultiGetSet.JS - Quickly generate getters and setters for multiple attributes
var MultiGetSet = function(opt){
var getType = function(o) {
return ({}).toString.call(o).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
};
if(!opt.public || !opt.private)
return opt.public;
if(opt.handler && opt.handler.init)
Function.prototype.after = function (action) {
var func = this;
return function () {
var result = func.apply(this, arguments);
action.bind(this,arguments,result)();
return result;
};
};
Function.prototype.before = function (action) {
@threedaymonk
threedaymonk / grid.js
Created July 5, 2012 16:11
View and test vertical rhythm
(function(){
var isGridActive = false;
var lineHeight = function(){
return parseInt(window.getComputedStyle(document.body).lineHeight, 10);
};
var gridDataURL = function(){
var size = lineHeight();