Skip to content

Instantly share code, notes, and snippets.

@pascalpoitras
pascalpoitras / config.md
Last active May 7, 2024 14:03
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@tho
tho / osx-irssi-sasl
Created July 13, 2014 03:45
OS X, irssi, sasl
$ brew install irssi gmp
$ cpan install Crypt::OpenSSL::Bignum Crypt::Blowfish Crypt::DH::GMP
$ echo '[[ $SHLVL -eq 1 ]] && eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >> ~/.bashrc
$ mkdir -p ~/.irssi/scripts/autorun
$ (cd ~/.irssi/scripts/; wget https://freenode.net/sasl/cap_sasl.pl; ln -s ../cap_sasl.pl autorun/)
$ irssi
/sasl set <network> <nick> <password> DH-BLOWFISH
/sasl save
@tracker1
tracker1 / 01-directory-structure.md
Last active May 4, 2024 19:55
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@stav
stav / sitemap_generator_pipeline.py
Last active December 9, 2016 16:05
Scrapy sitemap generator pipeline
""" pipelines.py """
import collections
import scrapy
import scrapy.contrib.exporter
import myproject
class SitemapPipeline(object):
"""
Sitemap builder

Comparison of ASP.NET and Node.js for Backend Programming

We will compare ASP.NET and Node.js for backend programming.
Source codes from examples.

Updates

This document was published on 21.09.2015 for a freelance employer. Some changes since then (14.02.2016):

  1. Koa.js no longer uses co-routines, it has switched to Babel's async/await. yield and await are used almost in the same way, so I see no point to rewrite the examples.
@zeroseis
zeroseis / disable-auto-android-file-transfer.md
Created September 14, 2015 17:28
Disable auto start for Android File Transfer
  • Close Android File Transfer
  • Open Activity Monitor and kill “Android File Transfer Agent”
  • Go to where you installed “Android File Transfer.app” (I have it under /Applications)
  • Ctrl+click –> “Show package contents”
  • Go to Contents/Resources
  • Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
  • Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active April 25, 2024 13:54
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@drahosistvan
drahosistvan / viberdownloads.sh
Created December 11, 2016 13:25
Modify the download folder in Viber for OSX
#!/bin/bash
if [ -z "$1" ]
then
echo "Please specify a folder"
exit
fi
if [ -z "$2" ]
then
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active March 2, 2023 13:29
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@VictorTaelin
VictorTaelin / promise_monad.md
Last active April 28, 2024 13:28
async/await is just the do-notation of the Promise monad

async/await is just the do-notation of the Promise monad

CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.

In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.

First, let's illustrate the 3 styles by implementing