Skip to content

Instantly share code, notes, and snippets.

View gabeio's full-sized avatar

Gabe De Luca gabeio

View GitHub Profile
@gabeio
gabeio / watch-build.sh
Last active January 3, 2017 04:09
golang watch and build
CompileDaemon \
--color=true\
--recursive=false\
--include="*.go"\
--exclude-dir="vendor"\
--build="go build --race"\
--command="pkill -HUP torch"
@gabeio
gabeio / pauser.sh
Last active October 25, 2016 02:35
process pauser
#!/bin/bash
# A small script to keep a laptop cool while running something like an install for a long time
# in this version it pauses all of the given process by name
# usage:
# ./pauser.sh <process name> <pause interval>
while true; do
pkill -CONT $1
sleep 1
@gabeio
gabeio / pauser.sh
Created October 25, 2016 01:55
pauser
#!/bin/bash
# A small script to keep a laptop cool while running something like an install for a long time
while true; do
kill -CONT $1
sleep 1
kill -STOP $1
sleep 10
done

Keybase proof

I hereby claim:

  • I am gabeio on github.
  • I am gabeio (https://keybase.io/gabeio) on keybase.
  • I have a public key ASAKdtDd4b6-9AWe2-uU0KGQf5Z7wXP2-WE0gj5PsIE0aAo

To claim this, I am signing this object:

[package]
name = "rnag"
version = "0.1.0"
[dependencies]
hyper = "0.9"
[[bin]]
name = "rnag"
path = "src/main.rs"
use std::io::{BufReader,BufRead};
use std::fs::File; // File::open
use std::env; // argv_os
fn main() {
let fd = BufReader::new(File::open(env::args_os().nth(1).unwrap()).unwrap());
let arr: Vec<Vec<f64>> = fd.lines()
.map(|l| l.unwrap().split(';')
.map(|number| number.parse().unwrap())
.collect())
(\()'(.*)'(,(<-)?errs?\))
@gabeio
gabeio / pp.rs
Last active February 19, 2016 23:46
Prime-Palindrome in rust
fn main() {
let mut v:Vec<i32> = vec![2];
for _ in 0..1000 {
let prime = primes(&v);
if prime == -1 {
break;
}
v.push(prime);
}
'top:for prime in v.iter().rev() {
@gabeio
gabeio / max-element.rs
Created February 17, 2016 17:34
maximum element stack in rust
use std::io;
use std::io::Write; // for stderr
fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap(); // read line into s
let n:Vec<i32> = s.split_whitespace().
map(|x| x.trim().parse().unwrap()).
collect();
writeln!(&mut std::io::stderr(), "n|{}", n[0]).unwrap();
@gabeio
gabeio / git-ignore
Created February 10, 2016 03:19
Ignore file revisions in local repository
git update-index --assume-unchanged