Skip to content

Instantly share code, notes, and snippets.

View robinpokorny's full-sized avatar

Robin Pokorny robinpokorny

View GitHub Profile
@infertux
infertux / mirror-github.sh
Last active August 12, 2022 09:07
A little Bash script to make a mirror of your Github repositories and keep them up-to-date.
#!/bin/bash
# A little Bash script to make a mirror of your Github repositories and keep
# them up-to-date.
# Why mirroring? Because I can!
# Also, it will be very useful if one day a meteorite crashes into Github
# servers (even if it will not happen).
# https://gist.github.com/950441
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mpj
mpj / classless.md
Last active November 13, 2023 16:34

The future is here: Classless object-oriented programming in JavaScript.

Douglas Crockford, author of JavaScript: The Good parts, recently gave a talk called The Better Parts, where he demonstrates how he creates objects in JavaScript nowadays. He doesn't call his approach anything, but I will refer to it as Crockford Classless.

Crockford Classless is completely free of class, new, this, prototype and even Crockfords own invention Object.create.

I think it's really, really sleek, and this is what it looks like:

function dog(spec) {
@mbohun
mbohun / example.md
Last active March 13, 2023 20:06
simple BASH/curl scipt for github REST API (HTTP GET queries)
$ ./githubapi-get.sh $GITHUBTOKEN /users/mbohun/repos
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 04 Mar 2015 04:30:29 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 155683
Status: 200 OK
// with static data, do filtering and sorting in the client
<Autocomplete
initialValue="Ma"
items={getUnitedStates()}
getItemValue={(item) => item.name}
shouldItemRender={(item, value) => (
state.name.toLowerCase().indexOf(value.toLowerCase()) !== -1 ||
state.abbr.toLowerCase().indexOf(value.toLowerCase()) !== -1
)}
sortItems={(a, b, value) => (
@joepie91
joepie91 / delay-promise.js
Last active July 29, 2022 20:02
ES6 Promise.delay
module.exports = function(duration) {
return function(){
return new Promise(function(resolve, reject){
setTimeout(function(){
resolve();
}, duration)
});
};
};
@machal
machal / pravidla.md
Last active September 18, 2018 13:26
FB/Frontendisti – pravidla

Pravidla diskuzní skupiny Frontendisti.cz

Skupina je spravována pro podporu komunity http://frontendisti.cz/.

  1. DRŽÍME TÉMA
    Diskutujeme hlavně o frontendu – CSS, HTML, JS se souvisejícími přesahy (backend, design). Tématu se držíme v otevřených diskuzích.
  2. NESPAMUJEME
    Nabídky práce patří na pracovní forum Frontendistů. https://www.facebook.com/groups/frontendistiprace/ Reklama na produkty a služby sem nepatří.
  3. NELADÍME CHYBY SOFTWARE
@yang-wei
yang-wei / destructuring.md
Last active February 20, 2024 04:40
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@bahmutov
bahmutov / index.js
Last active April 7, 2016 14:08
Is it pure?
// A: is this pure function?
function sum(a, b) { return a + b }
// B: is this a pure function?
const k = 2
function addK(a) { return a + k }
// C: is this a pure function?
function sub(a, b) { return sum(a, -b) }
// D: is this a pure function?
function sub(a, b, summer) { return summer(a, b) }
// E: is this a pure function?