Skip to content

Instantly share code, notes, and snippets.

View talk.vimrc
" augroup reload_talk_vimrc
" autocmd!
" autocmd BufWritePost *.vimrc source ~/dev/talk.vimrc
" augroup END
" ================ General Config ================
set nocompatible
syntax enable
set encoding=utf-8
@sebmarkbage
sebmarkbage / Enhance.js
Last active Nov 20, 2020
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
View async-mocha.js
"use strict";
var Promise = require("bluebird");
describe("ES7 async functions in Mocha", function() {
it("are really cool!", async function(){
console.log("waiting...");
await Promise.delay(1000);
@ThomasCrevoisier
ThomasCrevoisier / ClojureScript_example
Created Dec 17, 2014
Simple example of ClojureScript
View ClojureScript_example
(ns poney.world)
(defn hastalavistaify [xs]
(str "Hasta la vista " xs))
(hastalavistaify "Thomas") ;;; Outputs : "Hasta la vista Thomas"
(map hastalavistaify ["Thomas" "poney" "mutability"]) ;;; Outputs : ("Hasta la vista Thomas" "Hasta la vista poney" "Hasta la vista mutability")
@btford
btford / chillax.md
Created Oct 30, 2014
Why you shouldn't worry so much about migrating with Angular
View chillax.md

Several developers asked me about how difficult it will be to migrate Angular 1 to Angular 2. Angular 2 isn't done, so I legitimately have no idea how hard it will be. But there are a few high-level guiding principals in the design of Angular 1 that make adapting to changes like this fairly painless.

Angular 1 was designed so it would have a fairly minimal API surface. Let's look at controllers, since these are the meat of your app. Controllers are just functions that get passed other components as arguments:

MyController ($scope) {
  $scope.list = [];
  
  $scope.addItem = function (name) {
    $scope.list.push({
@stefansundin
stefansundin / install-pre-push.sh
Last active Jul 22, 2020
Git pre-push hook to prevent force pushing the master branch.
View install-pre-push.sh
#!/bin/sh
# This script will install a Git pre-push hook that prevents force pushing the master branch.
# Global installation instructions:
# mkdir $HOME/.githooks
# git config --global core.hooksPath $HOME/.githooks
# curl -fL -o $HOME/.githooks/pre-push https://gist.githubusercontent.com/stefansundin/d465f1e331fc5c632088/raw/pre-push
# chmod +x $HOME/.githooks/pre-push
# Uninstall:
# rm $HOME/.githooks/pre-push
@zbabtkis
zbabtkis / StyleCopier.js
Last active Dec 30, 2015
Utility function to copy rules from all stylesheets to another document
View StyleCopier.js
/**
* Utility function to copy rules from all stylesheets to another document
*
* @author Zachary Babtkis <zackbabtkis@gmail.com>
* @date December 4th 2013
* @License WTFPL
*/
/**
* copy styles
@endolith
endolith / Has weird right-to-left characters.txt
Last active Nov 23, 2020
Unicode kaomoji smileys emoticons emoji
View Has weird right-to-left characters.txt
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
You can’t perform that action at this time.