Skip to content

Instantly share code, notes, and snippets.

Devin Samarin dsamarin

View GitHub Profile
View ihs.sh
#!/bin/bash
SSH_HOST=dsamar.in
SSH_SOCKET=~/.ssh/ihs.dsamar.in.sock
SSH_TUNNEL=3306:localhost:3306
ssh -fMnNT -S "$SSH_SOCKET" -L "$SSH_TUNNEL" "$SSH_HOST"
gnucash mysql://ihs@127.0.0.1/ihs
ssh -S "$SSH_SOCKET" -O exit "$SSH_HOST"
View keybase.md

Keybase proof

I hereby claim:

  • I am dsamarin on github.
  • I am dsamarin (https://keybase.io/dsamarin) on keybase.
  • I have a public key whose fingerprint is D66E EE9F 9E05 4755 E78A 94FB D88E 7EEB 39AC FFEC

To claim this, I am signing this object:

View test.java
public class System {
private static final System mInstance = new System();
static {
java.lang.System.loadLibrary("mylib");
}
private System() {
construct();
}
@dsamarin
dsamarin / licenses.txt
Created Aug 15, 2017
Licenses used in dependencies of Soundmesh Desktop
View licenses.txt
@material/animation@0.3.1 [license(s): Apache-2.0]
└── package.json: Apache-2.0
@material/auto-init@0.1.3 [license(s): Apache-2.0]
└── package.json: Apache-2.0
@material/base@0.2.3 [license(s): Apache-2.0]
└── package.json: Apache-2.0
@material/button@0.3.11 [license(s): Apache 2.0]
View oscillators.cpp
#include <cmath>
#include <complex>
class Oscillator {
private:
double mRate;
double mReal;
double mImag;
public:
@dsamarin
dsamarin / graycode.js
Last active Aug 29, 2015 — forked from silentmatt/graycode.js
JavaScript functions to convert to/from binary-reflected Gray codes
View graycode.js
Number.toGrayCode = function(n) {
if (n < 0) {
throw new RangeError("cannot convert negative numbers to gray code");
}
return n ^ (n >>> 1);
};
Number.fromGrayCode = function(gn) {
if (gn < 0) {
throw new RangeError("gray code numbers cannot be negative");
@dsamarin
dsamarin / gist:5633174
Created May 23, 2013
Example xz.js API with navigator.cores
View gist:5633174
save_button.addEventListener("click", function() {
xz.compress(serializeDB(), function(compressed) {
saveAs(compressed, "db.xz");
});
});
View pipes.sh
#!/bin/bash
# The author of the original script is unknown to me. The first entry I can
# find was posted at 2010-03-21 09:50:09 on Arch Linux Forums (doesn't mean the
# poster is the author at all):
#
# https://bbs.archlinux.org/viewtopic.php?pid=728932#p728932
#
# I, Yu-Jie Lin, made a few changes and additions:
#
# -p, -R, and -C
View fruitsort.c
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
struct node;
struct edge;
struct node {
char *name;
struct edge *edges;
View showip.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <netinet/in.h>
int main (int argc, char *argv[]) {
You can’t perform that action at this time.