Skip to content

Instantly share code, notes, and snippets.

@nguyent
nguyent / gist:5358240
Last active December 16, 2015 01:49
code comments from work
# This group needs to be in a composition relationship with the
# Application group. WHY??? We used to have a document at xyz
# explaining why this was so, but I don't know where it is.
# xxx@xyz.net
# If this works, I'll be the luckiest freaking man ever. Whoever did
# the relation stuff was either much smarter than me, or hated programmers.
# See for instance register/user-join.tcl if you want to be freaked out.
# You might wonder why level is aliased as mylevel here. Well, for some
@nguyent
nguyent / Sublime Text end of line
Created May 29, 2013 22:11
key binding definition for emmet in ST2, to allow ctrl+e to go to eol vs expand (come on now, sublime)
{
"keys": [
"ctrl+e"
],
"args": {
"to": "eol",
"extend": false
},
"command": "move_to"
}
@nguyent
nguyent / gist:5758816
Created June 11, 2013 17:19
Javascript weirdness
/*
An interesting wart I came across today.
*/
if (true) {
function sup() {
return 'yes';
}
@nguyent
nguyent / repocheck.py
Created May 29, 2014 18:55
grep gitolite repos for a string
#!/usr/bin/env python
import subprocess
import sys
import os
import time
# Relative path to repo directory
repoDir = 'repos'
git = 'gitolite@git.herpderp.com'
@nguyent
nguyent / 0_reuse_code.js
Created June 6, 2014 03:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
## Attempting to use puppet to install logstash with java already installed
fpm -s empty -t rpm --depends jre -n zc-jre-1.7.0 --provides 'jre = 1.7.0' --provides 'jdk = 1.7.0'
=> zc-jre-1.0-1.x86_64.rpm
# logstash rpm via: https://download.elasticsearch.org/logstash/logstash/packages/centos/logstash-1.4.2-1_2c0f5a1.noarch.rpm
[vagrant@logstash tmp]$ rpm -qp --requires logstash-1.4.2-1_2c0f5a1.noarch.rpm
jre >= 1.6.0
@nguyent
nguyent / ranges.py
Created September 27, 2016 22:39
given a list of dates, create a list of lists containing contiguous ranges Raw
from datetime import timedelta
from datetime import datetime
def toDate(s):
return datetime.strptime(s, '%Y-%m-%d')
def consecutive(d1, d2):
return toDate(d1) + timedelta(days=1) == toDate(d2)
def findRangesRecursive(dates, acc=[], candidate=[]):

But you see, I have, let's say, sixty years to live. Most of that time will be spent working. I've chosen the work I want to do. If I find no joy in it, then I'm only condemning myself to sixty years of torture. And I can find the joy only if I do my work in the best way possible to me. But the best is a matter of standards—and I set my own standards. I inherit nothing. I stand at the end of no tradition. I may, perhaps, stand at the beginning of one.

...

Listen to what is being preached today. Look at everyone around us. You’ve wondered why they suffer, why they seek happiness and never find it. If any man stopped and asked himself whether he’s ever held a truly personal desire, he’d find the answer. He’d see that all his wishes, his efforts, his dreams, his ambitions are motivated by other men. He’s not really struggling even for material wealth, but for the second-hander’s delusion – prestige. A stamp of approval, not his own. He can find no joy in the struggle and no joy when he has succeeded. He ca

@nguyent
nguyent / notes.bash
Created February 6, 2017 16:48
notes
# cartesian product via https://www.quora.com/What-is-the-most-succinct-way-to-compute-a-Cartesian-product-in-bash
join -j 2 f1 f2
https://configure.ergodox-ez.com/keyboard_layouts/qynlrd/edit
$ ./teensy_loader_cli -w --mcu=atmega32u4 *.hex
# reset