Skip to content

Instantly share code, notes, and snippets.

@jamiees2
jamiees2 / async-file-tailer.js
Last active December 4, 2021 11:40
An asynchronous file tailer
const fs = require("fs/promises");
const fsWatch = require("fs").watch;
const fsExistsSync = require("fs").existsSync;
const assert = require("assert");
class FileTailer {
constructor(filepath, logger = console) {
this.filepath = filepath;
this.watcher = null;
this.watching = false;
@jamiees2
jamiees2 / wtf.js
Created February 22, 2017 10:58 — forked from GooseNinja/lol.js
for (let i = 0; i < 10; i++) {
console.log(i);
}
console.log('360 no-scope', i);

Keybase proof

I hereby claim:

  • I am jamiees2 on github.
  • I am jameselias (https://keybase.io/jameselias) on keybase.
  • I have a public key whose fingerprint is 0AD4 D571 6EC5 EF63 AA44 1BCF 540F 3E19 921A 77E4

To claim this, I am signing this object:

@jamiees2
jamiees2 / eye-test.js
Last active August 29, 2015 14:23
eye-test
setInterval(function(){
window.frames[0].document.querySelectorAll(".thechosenone")[0].style.backgroundColor = 'white';
},1500)
@jamiees2
jamiees2 / det.py
Created June 2, 2015 23:51
A fast LU decomposition algorithm, along with computing the determinant
def matrixMul(A, B):
TB = list(zip(*B))
return [[sum(ea*eb for ea,eb in zip(a,b)) for b in TB] for a in A]
def pivotize(m):
"""Creates the pivoting matrix for m."""
n = len(m)
ID = [[float(i == j) for i in range(n)] for j in range(n)]
r = 0
for j in range(n):
@jamiees2
jamiees2 / sheet.tex
Last active July 8, 2021 16:59
A template for LaTeX cheat sheets
% \documentclass[9pt,a4paper,twocolumn,landscape,oneside]{amsart}
\documentclass[9pt,a4paper,landscape,oneside]{amsart}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{fullpage}
%\usepackage{geometry}
@jamiees2
jamiees2 / stylecheck.sh
Created January 19, 2015 22:04
client side hjalti shit
#!/bin/bash
DIR="$(cd "$(dirname "$0")" && pwd)"
echo "Running N'SIQ on" $1
echo "==========================================="
$DIR/nsiqcppstyle/nsiqcppstyle -f $DIR/profiles/nsiq-profile.txt $1
echo ""
echo "==========================================="
echo "N'SIQ finished"
echo "Now running vera++ on" $1
upstream blah_cluster {
server ip;
}
server {
server_name blah;
access_log /srv/logs/blah.log;
error_log /srv/logs/blah-error.log;
@jamiees2
jamiees2 / gist:6fd9805fb58fc0329c21
Created May 18, 2014 20:29
Set a git repository to its ssh version
git remote set-url origin $(echo "git@bitbucket.org:<TEAM>/$(git remote -v | grep -oh "[^/]*\.git" | head -n1)")
@jamiees2
jamiees2 / 0_reuse_code.js
Created March 20, 2014 11:42
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