Skip to content

Instantly share code, notes, and snippets.


Dmitriy Tkalich creativ

View GitHub Profile
View react-lifecycle-parent-child.jsx
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
staltz /
Last active Dec 4, 2020
The introduction to Reactive Programming you've been missing
jbenet /
Last active Nov 26, 2020
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active Dec 2, 2020
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

aras-p / preprocessor_fun.h
Last active Dec 2, 2020
Things to commit just before leaving your job
View preprocessor_fun.h
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
eliotsykes / ngFocusAndBlur.js
Created Apr 16, 2013
AngularJS ngFocus and ngBlur directives - one way to get them before they get released. Before using, consider re-naming ngFocus and ngBlur to something that doesn't invade the ng namespace, e.g. replace all 'ngFocus' and 'ngBlur' strings with 'ngcFocus' and 'ngcBlur' (where c = cats/custom).
View ngFocusAndBlur.js
app.directive('ngFocus', ['$parse', function($parse) {
return function(scope, element, attr) {
var fn = $parse(attr['ngFocus']);
element.bind('focus', function(event) {
scope.$apply(function() {
fn(scope, {$event:event});
ndarville /
Last active Dec 4, 2020
Business models based on the compiled list at I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models


Models Examples
Display ads Yahoo!
Search ads Google
# git-svn-diff originally by (
# modified by
# modified by aconway@[redacted] - handle diffs that introduce new files
# modified by - fixes diffs that introduce new files
# modified by - fix sed syntax issue in OS X
# Generate an SVN-compatible diff against the tip of the tracking branch
isaacs /
Last active Dec 3, 2020
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl | sh
You can’t perform that action at this time.