Skip to content

Instantly share code, notes, and snippets.

View robinweser's full-sized avatar

Robin Weser robinweser

View GitHub Profile
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@mbostock
mbostock / .block
Last active October 29, 2024 20:34
Force-Directed Graph
license: gpl-3.0
height: 600
redirect: https://observablehq.com/@d3/d3-force-directed-graph
(function(){Array.prototype.slice.call(document.querySelectorAll('[data-reactid]')).forEach(function(ele){ele.style.background = 'rgba(0, 129, 255, 0.05)'})})();
RegExp.prototype.matches = function* (str) {
let moreThanOnce = this.global || this.sticky;
let myLastIndex = 0;
do {
// preserve lastIndex of another .exec() calls on same regexp
let savedLastIndex = this.lastIndex;
// use own state for lastIndex to match our str
this.lastIndex = myLastIndex;
let match = this.exec(str);
@MicheleBertoli
MicheleBertoli / StyleSheet.js
Created February 15, 2016 20:33
React Look: Extract CSS File
export(userAgent) {
return StyleContainer.renderStaticStyles(userAgent)
}
@mxstbr
mxstbr / Readme.md
Last active October 20, 2024 20:44
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@mmazzarolo
mmazzarolo / Appfile
Created May 17, 2016 11:27
Simple Fastlane setup for React-Native (Android - iOS)
# iOS
app_identifier "com.myapp.app" # The bundle identifier of your app
apple_id "[email protected]" # Your Apple email address
team_id "1234ABCD" # Developer Portal Team ID
# Android
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "com.myapp.app" # Your Android app package
@ericclemmons
ericclemmons / example.md
Last active September 20, 2024 12:46
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@funkybunky
funkybunky / Lightning.md
Last active March 31, 2017 12:07
Lightning talk proposal for ReactiveConf 2016

NOTE: Please Star this Gist if you like it! Only the highest voted proposals actually get presented at ReactiveConf To share the affection, please consider retweeting :)

The Zen of Coding - How to Reduce Your Average WTFs/minute

Comic showing that WTFs per minute are the only true indicator of code quality

In this somewhat unorthodox lightning talk I will share a simple meditation technique that I apply regularly in my daily coding. It helps me to solve problems faster and come up with new solutions while at the same time being calm and less stressed out after work. Also my back pain reduced significantly. And as a result your WTFs/minute will dramatically decrease as well..

@piascikj
piascikj / init.coffee
Created January 27, 2017 14:45
~/.atom/init.coffee to close notifications after 2 seconds
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->