Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
https://www.robingruenke.com/journal/blogging/tools/how-my-journal-is-build.html

Robin Gruenke eimfach

💭
https://www.robingruenke.com/journal/blogging/tools/how-my-journal-is-build.html
View GitHub Profile
@dustintheweb
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
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
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
jonfalcon / object-keys-polyfill.js
Created Feb 5, 2013
Javascript: Object keys polyfill
View object-keys-polyfill.js
/**
* Polyfill for Object.keys
*
* @see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/keys
*/
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
patrickarlt / build.sh
Last active Mar 25, 2020
ES 7 async/await demo!
View build.sh
babel github-es6.js -o github.js --optional runtime --experimental
@JoelQ
JoelQ / elm-generic-types-exercises.md
Last active May 26, 2020
Short exercises to learn how generic types and type variables work in Elm.
View elm-generic-types-exercises.md

Generic Elm types exercises

A series of exercises to get a feel for how generic types and type variables work in Elm. For each of these, you are given some code that is not compiling. Your task is to get it compiling. You can change the body of the function but not the signature. No cheating with Debug.todo or infinite recursions either 😉

@jeffmo
jeffmo / gist:054df782c05639da2adb
Last active Nov 24, 2020
ES Class Property Declarations
View gist:054df782c05639da2adb
@marianposaceanu
marianposaceanu / linux_fun.md
Last active Jun 21, 2021
How to have some fun using the terminal.
View linux_fun.md

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
g-P / print_gitbook.js
Last active Jun 27, 2021
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-header,.book-summary,.navigation,.book-progress").remove();
$(".book.with-summary .book-body").css('left', '0px');
$("*").css('position', 'static');
window.print()