Skip to content

Instantly share code, notes, and snippets.

View bradleybossard's full-sized avatar

Bradley Bossard bradleybossard

View GitHub Profile
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@louisremi
louisremi / animLoopX.js
Created July 29, 2011 17:34
Animation loop with requestAnimationFrame
// Cross browser, backward compatible solution
(function( window, Date ) {
// feature testing
var raf = window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.oRequestAnimationFrame;
window.animLoop = function( render, element ) {
var running, lastFrame = +new Date;
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 25, 2024 07:26
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Nurdok
Nurdok / python_conversion.md
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression
@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@kogakure
kogakure / gist:4769904
Created February 12, 2013 13:31
SASS: Circle Mixin
@mixin circle($width, $color) {
width: $width;
height: $width;
background: $color;
-webkit-border-radius: $width/2;
-moz-border-radius: $width/2;
border-radius: $width/2;
}
.circle {
@jordanorelli
jordanorelli / gif_example.pde
Created February 20, 2013 02:38
make an animated gif with Processing
import gifAnimation.*;
GifMaker gifExport;
int frames = 0;
int totalFrames = 120;
public void setup() {
smooth();
size(400, 400);
@copitux
copitux / filters.py
Last active December 18, 2015 11:09
Iso 8601 DateTimeFilter to Django Rest Framework and django-filter
"""
The MIT License (MIT)
Copyright (c) <2013> <David Medina>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
anonymous
anonymous / dabblet.css
Created July 26, 2013 14:43
Attempt for Chrome-style progress-indicator with SVG and CSS animations
/**
* Attempt for Chrome-style progress-indicator with SVG and CSS animations
*/
@keyframes spin {
to {
stroke-dashoffset: -264;
}
}
@bradcrawford
bradcrawford / feedly_export_saved_for_later
Last active February 26, 2024 07:07
Simple script that exports a users "Saved For Later" list out of Feedly as a JSON string
// Simple script that exports a users "Saved For Later" list out of Feedly
// as a JSON string.
//
// This was intended for use in the Google Chrome's "Inspector" tool so your
// mileage may vary if used in other contexts.
//
// Format of JSON is as follows:
// [
// {
// title: "Title",