This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup your packages list | |
# Get a packages list | |
dpkg --get-selections > ~/Package.list | |
# Copy list of repositories | |
sudo cp /etc/apt/sources.list ~/sources.list | |
# Export repo keys | |
sudo apt-key exportall > ~/Repo.keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::sync::{Arc, Mutex}; | |
use std::sync::Condvar; | |
use std::thread; | |
use std::collections::HashMap; | |
use std::time::Duration; | |
struct Node<T> { | |
value: T, | |
next: Option<Arc<Mutex<Node<T>>>>, | |
previous: Option<Arc<Mutex<Node<T>>>>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A UNIX socket server written in pure Rust | |
use std::io::Read; | |
use std::os::unix::net::{UnixListener, UnixStream}; | |
use std::path::Path; | |
fn main() { | |
let socket = Path::new("/tmp/echo.sock"); | |
if socket.exists() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[io.confluent.parallelconsumer/parallel-consumer-core "0.3.0.2"] | |
[fundingcircle/jackdaw "0.8.0"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.vimrc | |
" Map leader to comma | |
let maplocalleader="," | |
" Toggle this for vim-sexp to not go into insert mode after wrapping something | |
let g:sexp_insert_after_wrap = 0 | |
" Toggle this to disable automatically creating closing brackets and quotes | |
let g:sexp_enable_insert_mode_mappings = 1 | |
Vocab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn explain-schema [] | |
(p/let [editor-data (editor/get-var)] | |
(when editor-data | |
(-> editor-data | |
(update :text #(str "(if (satisfies? schema.core/Schema " % ") " | |
"(schema.core/explain " % ")" | |
"(or #?(:cljs nil :default (:schema (meta (ns-resolve *ns* '" % "))))" | |
"\"Is not a schema\"))")) | |
(editor/eval-and-render))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Originally from https://gist.github.com/IanVaughan/2902499 | |
# | |
# authors: Ian Vaughan | |
# Jacob Zimmerman | |
# | |
# usage: uninstall_gems [<version> ...] | |
# | |
# examples: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove zero-width spaces | |
:%s/\%u200b//g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove zero-width spaces | |
:%s/\%u200b//g |
NewerOlder