Skip to content

Instantly share code, notes, and snippets.


Robin Gruenke eimfach

View GitHub Profile
dustintheweb / stock-android-browser-check.js
Created Jul 8, 2013
Check if the browser user agent is the stock android browser.
View stock-android-browser-check.js
// Stock Android Browser Check >>>>>>>>>>>>>>>>
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1 && ua.indexOf("mobile") && ua.indexOf("chrome")==-1
if(isAndroid) {
// stuff
bergantine / gist:5243223
Last active Sep 27, 2018
CSS grayscale filter (go from grayscale to full color on hover) #css #sethneilson
View gist:5243223
img:hover {
-webkit-filter: grayscale(0%);
-webkit-transition: .5s ease-in-out;
-moz-filter: grayscale(0%);
-moz-transition: .5s ease-in-out;
-o-filter: grayscale(0%);
-o-transition: .5s ease-in-out;
img {
dtipson / IO plus Array & Promise helpers.js
Last active Oct 1, 2019
Bare bones FP type utility lib so we can play around with functions that capture the composition of DOM read/writes, but in a pure way
View IO plus Array & Promise helpers.js
// Let's make it possible to create pure functions even when we're
// dealing with impure operations that would have side effects!
// First we'll need a "Type" that can contain a (sometimes impure) function
function IO(fn) {
if (!(this instanceof IO)) {//make it simpler for end users to create a type without "new"
return new IO(fn);
this.runIO = fn;//IO now provides an extra control layer that allows the composition of unexecuted effects
jonfalcon / object-keys-polyfill.js
Created Feb 5, 2013
Javascript: Object keys polyfill
View object-keys-polyfill.js
* Polyfill for Object.keys
* @see:
if (!Object.keys) {
Object.keys = (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
View gist:c78768f9837afb8eef74
def f(diff, n):
This function returns the new difficulty.
period_count = (n + 1) // 100000
return max(diff + 2**(period_count - 1), 5000)
diff = 6232935860523 # starting diffculty
blocknumber = 200000 # starting blocknumber
numberOfBlocks2years = 2*365*24*60*60/15
patrickarlt /
Last active Mar 25, 2020
ES 7 async/await demo!
babel github-es6.js -o github.js --optional runtime --experimental
jeffmo / gist:054df782c05639da2adb
Last active Nov 24, 2020
ES Class Property Declarations
View gist:054df782c05639da2adb
marianposaceanu /
Last active Dec 5, 2021
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
g-P / print_gitbook.js
Last active Jan 26, 2022
Print Git Books
View print_gitbook.js
If you try to print a gitbook directly, you get nothing but the contents because of their *just* use of `@media print` styling to hide away the content section of the books.
Fret not, here is the codez:
$(".book.with-summary .book-body").css('left', '0px');
$("*").css('position', 'static');
JoelQ /
Last active Mar 12, 2022
Elm Type Glossary

Elm Types Glossary

There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.