Skip to content

Instantly share code, notes, and snippets.

View TimPietrusky's full-sized avatar
🎶
shouldUpdate()

NERDDISCO TimPietrusky

🎶
shouldUpdate()
View GitHub Profile
@ayamflow
ayamflow / rotate-uv.glsl
Created January 16, 2018 23:24
Rotate UV in GLSL
vec2 rotateUV(vec2 uv, float rotation)
{
float mid = 0.5;
return vec2(
cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,
cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid
);
}
vec2 rotateUV(vec2 uv, float rotation, vec2 mid)
/* OctoWS2811 - High Performance WS2811 LED Display Library
http://www.pjrc.com/teensy/td_libs_OctoWS2811.html
Copyright (c) 2013 Paul Stoffregen, PJRC.COM, LLC
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
furnished to do so, subject to the following conditions:
@Haroenv
Haroenv / Bug Titles
Created March 14, 2016 17:07
Bug Movie Titles
The Bug Lebowski
A Bug's Life
The Bug
My Bug Fat Greek Wedding
Bug Hero 6
Bugman Rising
Bug (1988)
Pee-wee's Bug Holiday
The Bug Short
Lord of the Bugs: The Two Bugs
@telekosmos
telekosmos / uniq.js
Last active November 15, 2022 17:13
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
@jessefrye
jessefrye / radness.less
Last active August 29, 2015 14:21
Radness in Atom Editor
@rad: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAusAAADfCAYAAABPjZ2vAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAS1JJREFUeNrsnQeYVsXVxw+2gGLBnsSKMcZewLqoSECNid1FYy8R1Ng1ATt2sHcFSxKjVGvUfCrr2rKWCHbFWIixx4a9I9/5O7Px7uv77r7lzp2Ze/+/5znPKrD3zj0zc+fMuWfO6bbv4SOEEEIIIYRkzkMq6zq8/pkqf6Saw2PM2SdU/W/noLoIGNDUhLHQU2VulbmokVSYpfJh+/+0trV9QJWQAOb6bPpjPpUFqI0f8I3KJ3X83qc6v7+m+kiNDHJsqH+rcgnVHD801rlwd9cf71hDnbjVNX58ZmWGyrsqb1t5TeUVlZdV/o3/1sV/FrVWl5576I/pKj0ifYSh2vcTHOhloP64VmVRjhIn4+5zuzmfYefzm3Y+v6jygsqz2q8fUVMkwTGOr3+zHYOExjqJnHloqGfK3FYWVlm+k3/3qS7+0/TnMyqPi/lU+pgu9l9ShV2ylcriEbd/iMoEB9ftSUPdKT2sYOytWMGgxybyMZWHVe5XeVTn9FdUXSHpr7Kx43ucQTXTWCf5YF6qINhNVF8re9g/+1oXexjud6vcqdKmC/0XVNUP2Cny9g/Qfl5O+/YldmXu6G1le/v/n2tfYz7foXIb+7xQjHB8/XvFOHkIjXWSA7pTBdEwp8raVnBg6Atd6O/Rn9ep3KIL/dtFV5DqY379sUUOHmVvcf+JnPinhx2vkPN1/MLrfqPKWBruuaa/uPeqj6Sa88NsVAGNdaog6r7bXOUKlTd1ob9LZS+VeQqsE3gs83BAeg97EJQUizVVTlJ5Ufv/PpVdVXjgP3+McHx9fIG9nWqmsU4ICW8uD1C5SuUtXeAvV1mlgHrYMSfP8VOVDTmsCw36/68qr+lcPk6lF1WSCzYQetUJjXVCCg8OEv5O5Sld4O9Q2a
@geelen
geelen / 1_Readme.md
Last active August 29, 2015 14:21
Traits

Global traits, local components

The idea is to combine the best bit of global styling (reuse, small payload) and local styling (total isolation, first-class React syntax)

This is combined with the concept of traits: you can think of them as permitted property/value pairs. Instead of every component being able to have every CSS property available to it, you can reduce your permitted set to X font families, Y font-size + line-height pairs, Z foreground/background colour pairs, W padding amounts. This is based off my work using amcss on real projects — traits were the single key feature that kept me using AM.

The one-sentence explanation: A site defines a set of permitted visual features, all components are simply a combination of those features

Definitions

@subzey
subzey / gist:b18c482922cd17693d65
Last active August 29, 2015 14:06
Few Tricks on Compressing Js13k Entry

Few Tricks on Compressing Js13k Entry

Most important detail: in js13k entry 13k stands for zipped entry size. And this detail makes js13k differ from other code golfing compos.

Last year winner entry uncompressed size was about 70k. 70 kilobytes! In js1k you have a month to minify 1k, so how much time would it take to minify 70k? Nope, you have only 1 month. So it's very unlikely one will manually golf the entry. And this is the other thing that makes js13k special: no hardcore manual "hell yeah I've stripped one byte!" golfing.

@staltz
staltz / introrx.md
Last active May 23, 2024 09:20
The introduction to Reactive Programming you've been missing
@KittyGiraudel
KittyGiraudel / gist:9488917
Created March 11, 2014 16:04
A question regarding Sass & Gzip

About Sass and Gzip

Hey guys! I have a question regarding Sass usage and Gzip compression. If anyone knows something, be sure to share. :)

A quick reminder

It's good practice to use Sass @extend rather than including mixins when possible because of the way Sass handles @extend. To put it simple, it doesn't take the CSS content from the extended selector to place them in the extending one. It works the other way around: it takes the extending selector and append it to the extended selector.

Placeholder