Skip to content

Instantly share code, notes, and snippets.

View eriknomitch's full-sized avatar

Erik Nomitch eriknomitch

View GitHub Profile

Sudo without a password (Linux and MacOS)

Get your username

$ whoami

Remeber this for later.

@eriknomitch
eriknomitch / installing-dependencies-for-fast-neural-doodle.md
Last active November 27, 2016 17:04
Installing Dependencies for fast-neural-doodle

Installing Dependencies for fast-neural-doodle

Install Torch

Torch / Getting Started

cd

git clone https://github.com/torch/distro.git ~/torch --recursive
@eriknomitch
eriknomitch / transmission-daemon-quickstart.md
Last active January 27, 2020 12:48
Transmission Daemon (transmission-daemon) Quickstart

Transmission Daemon (transmission-daemon) Quickstart

This should work for Debian or Debian-deriviants (e.g., Ubuntu)

Quickstart

Install transmission-daemon

sudo apt-get install transmission-daemon
@eriknomitch
eriknomitch / application_helper.rb
Last active November 11, 2016 15:28
A shorter and cleaner way to render partials in Rails
module ApplicationHelper
# Wraps the commonly used `render partial:` to just `partial`
def partial(path, options={}, &block)
render partial: path.to_s, **options, &block
end
end
@eriknomitch
eriknomitch / ESP8266.md
Last active May 20, 2016 00:32
ESP8266 (NodeMCU ESP-12E) Quickstart

This is a rough quickstart for the ESP8266 (NodeMCU ESP-12E) Development board. This is the one I use.

Download the Arduino IDE.

Go to Tools -> Board -> Board Manager

Search and install the esp8266 package.

Under Tools, make your settings look like this:

@eriknomitch
eriknomitch / script.js
Created February 19, 2016 17:54
Gmail Expiring Emails Script
# Based off of http://www.johneday.com/422/time-based-gmail-filters-with-google-apps-script
# See instructions on that page for adding it via script.google.com
function expireEmails() {
var delayDays = 2 // Enter # of days before messages are moved to trash
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays);
var labelExpiring = GmailApp.getUserLabelByName("Expiring");
var labelExpired = GmailApp.getUserLabelByName("Expired");
@eriknomitch
eriknomitch / prepend
Created September 18, 2015 15:41
Zsh script to prepend a file with string(s)
#!/bin/zsh
# ================================================
# PREPEND ========================================
# ================================================
# Prepends a string to a target file
# ------------------------------------------------
# TRAP->TERM -------------------------------------
# ------------------------------------------------
trap "exit 1" TERM
@eriknomitch
eriknomitch / example usage of 'silence'
Last active September 16, 2015 05:41
'silence' shell script for prefixing commands to send output to /dev/null
#!/bin/zsh
micro_host_suffixes=('white' 'green' 'orange')
for suffix in $micro_host_suffixes; do
echo -n "micro-$suffix... "
silence ssh -o "ConnectTimeout 10" micro-$suffix true && echo up || echo down
done
@eriknomitch
eriknomitch / Circular File System Concept.md
Last active May 30, 2022 08:13
"Circular File System" Concept

Circular File System Concept

Description

A filesystem (most likely virtual via FUSE) where:

1.) A directory index contains a list of all the (unique) directories and subdirectories in the tree. Example:

~/example
@eriknomitch
eriknomitch / tampermonkey_cs_to_js.js
Last active August 29, 2015 14:12
Tampermonkey CoffeeScript to JavaScript Evaluator
function evalCS(source) {
// Compile source to Coffeescript (Array)
var coffeescript = CoffeeScript.compile(source.toString()).split("\n");
// Prepend 'debugger'
coffeescript[1] = "debugger;" + coffeescript[1];
// Join and eval
eval(coffeescript.join("\n"));