Skip to content

Instantly share code, notes, and snippets.

bessarabov / gist:674ea13c77fc8128f24b5e3f53b7f094
Last active Jul 19, 2019
One-liner to generate data shown in post 'At what time of day does famous programmers work?' —
View gist:674ea13c77fc8128f24b5e3f53b7f094
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
amatellanes /
Last active Jul 19, 2019
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
Queue('default', routing_key='tasks.#'),
View material-theme.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
bradtraversy /
Last active Jul 19, 2019
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

yatemmma /
Last active Jul 19, 2019
git初心者への道 - お仕事で困らないレベルまでググっとします。


Level 1

まずやってみよう - コミットする、ログを見る、差分を見る

初登場するコマンド: init, add, commit, log, config, status, diff

Level 2

joshnuss / app.js
Last active Jul 19, 2019
Express.js role-based permissions middleware
View app.js
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./permission"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
fwyzard /
Last active Jul 19, 2019
Install CentOS 7 in an LXC/LXD container on an NVIDIA Xavier

Install and configure LXD

Install LXD

sudo snap install lxd

Perform the initial configuration

sudo lxd init
schickling / UIImageFixedOrientationExtension.swift
Last active Jul 19, 2019
Extension to fix orientation of an UIImage (Sets orientation to portrait)
View UIImageFixedOrientationExtension.swift
extension UIImage {
func fixedOrientation() -> UIImage {
if imageOrientation == UIImageOrientation.Up {
return self
var transform: CGAffineTransform = CGAffineTransformIdentity
ryanlecompte / gist:1283413
Created Oct 13, 2011
Providing an ActiveRecord-like before_filter capability to arbitrary Ruby classes
View gist:1283413
# First the end result of what we want:
class Foo
before_hook :whoa
before_hook :amazing
def test
puts "This is kinda cool!"
mari-linhares /
Last active Jul 19, 2019
Setting up a MSI laptop with GPU (gtx1060), Installing Ubuntu 18.04, CUDA, CDNN, Pytorch and TensorFlow
You can’t perform that action at this time.