Skip to content

Instantly share code, notes, and snippets.

View paulgreg's full-sized avatar

Grégory Paul paulgreg

View GitHub Profile
import React, { useContext } from 'react'
import ReactDOM from 'react-dom/server'
import ssrPrepass from 'react-ssr-prepass'
const Context = React.createContext()
const asyncFoo = async () => 'foo'
function MyComponent() {
const tracker = useContext(Context)
@0gust1
0gust1 / .bashrc
Created July 24, 2018 12:56
Working behind a corporate proxy - snippet to copy/paste in your shell rc file (or profile)
setProxy(){
export all_proxy=socks://url.to.proxy:80
export http_proxy=http://url.to.proxy:80
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export ALL_PROXY=$all_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export FTP_PROXY=$http_proxy
export no_proxy="localhost, 127.0.0.1, .internal.domain"
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@tdd
tdd / .jshintrc.js
Last active August 29, 2015 14:13
Ma config JSHint par défaut
// Configuration globale au projet de JSHint
// =========================================
//
// (Y compris celui intégré à votre EDI/éditeur, normalement)
//
// [Liste complète des options possibles](http://www.jshint.com/docs/options/)
{
// Options de restriction
// ----------------------
@Unitech
Unitech / http-wrapper.js
Last active March 16, 2016 07:41
Print user agent & co
var Proxy = require('./proxy.js');
var HttpWrap = module.exports = function(http) {
Proxy.wrap(http.Server.prototype, ['on', 'addListener'], function(addListener) {
return function(event, listener) {
if (!(event === 'request' && typeof listener === 'function')) return addListener.apply(this, arguments);
return addListener.call(this, event, function(request, response) {
var self = this;
@noreiller
noreiller / backup-full.sh
Last active January 4, 2016 16:30
Geeksphone Peak backup scripts
#!/bin/sh
BACKUP_DATE=`date +%Y-%m-%d_%H-%M-%S`
BACKUP_DIR="~/PEAK/BACKUPS/$BACKUP_DATE"
mkdir -p "$BACKUP_DIR"
cd "$BACKUP_DIR"
sudo adb pull /data/local/storage/persistent/
@staltz
staltz / introrx.md
Last active May 30, 2024 01:44
The introduction to Reactive Programming you've been missing
@olim7t
olim7t / git-standup.sh
Created October 1, 2012 08:44
git-standup: find out what you did yesterday (or last friday)
#!/bin/bash
# git-standup: find out what you did yesterday (or last friday).
#
# Setup:
# 1. Change AUTHOR if your git user doesn't match your unix account.
# 2. Save somewhere on your path, make executable.
# 3. git config --global alias.standup '!git-standup'
# 4. Profit.
#
# Original idea via @paulgreg (https://twitter.com/paulgreg/status/248686055727972352)
@tinifni
tinifni / gist:3756796
Created September 20, 2012 16:04
Remember what you've done since your last standup
# zsh script checks first if there were any commits done
# by author yesterday. If there were, return those. If
# there weren't, look for all commits since last Friday
# at midnight as it may have been a weekend.
#
# Use your name in the --author for all commands
gitstandup() {
if [ -z "$(git log --all --pretty=format:'* %s' --no-merges --reverse --author=Justin --since=yesterday.midnight)" ]; then
git log --all --pretty=format:'* %s' --no-merges --reverse --author=Justin --since=last.friday.midnight;
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'