Skip to content

Instantly share code, notes, and snippets.

View JonathanMH's full-sized avatar
🐙

Jonathan M. Hethey JonathanMH

🐙
View GitHub Profile
@JonathanMH
JonathanMH / git-ssh-debug.sh
Last active December 16, 2015 15:59
short test if your ssh key file is added for use with git
#!/bin/bash
# to automatically add a key you can use the following:
mac_key_path='/Users/hb/.ssh/foobar'
linux_key_path='/home/username/.ssh/foobar'
# uncommend below
# ssh-add $mac_key_path
# ssh-add $linux_key_path
@JonathanMH
JonathanMH / morse-node.js
Created May 3, 2013 21:34
make node.js blink your keyboard backlight in morse code (tested with speedlink illuminator)
var morse = require('morse');
var childProcess = require('child_process');
var async = require('async');
var encoded = morse.encode('SOS');
function onoff (duration, callback) {
childProcess.exec('xset led 3',function (error, stdout, stderr){
});
@JonathanMH
JonathanMH / float.html
Created August 14, 2013 08:40
simple html float example with cat content
<!DOCTYPE html>
<html>
<head>
<title>Float</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<style>
.left {
width: 300px;
float: left;
@JonathanMH
JonathanMH / 51-android.rules
Created September 10, 2013 07:33
android dev rules for linux
######################################################
# Project: http://code.google.com/p/51-android/ #
# File: /etc/udev/rules.d/51-android.rules #
# Author: snowdream <yanghui1986527@gmail.com> #
# Date: 2010.06.07 #
######################################################
#Acer
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0660", OWNER="snowdream"
@JonathanMH
JonathanMH / employee.csv
Last active January 15, 2016 11:25
newline problem with node-csv-parse
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 5 columns, instead of 6. in line 1.
Name,Gender,"preferred language",startDate,endDate
Barbara McFinley,Female,JavaScript,2015-13-01,,
@JonathanMH
JonathanMH / mdclip.go
Created May 3, 2017 10:25
Golang script for compiling markdown to HTML and copying to the clipboard
package main
import (
"log"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
<?php
/**
** A base module for [text], [text*], [email], and [email*]
**/
/* Shortcode handler */
wpcf7_add_shortcode( 'text', 'wpcf7_text_shortcode_handler', true );
wpcf7_add_shortcode( 'text*', 'wpcf7_text_shortcode_handler', true );
wpcf7_add_shortcode( 'email', 'wpcf7_text_shortcode_handler', true );
net stop w32time
net start w32time
w32tm /resync /nowait
# $trigger = New-JobTrigger -AtStartup -RandomDelay 00:00:30
# Register-ScheduledJob -Trigger $trigger -FilePath C:\Users\jonat\ntp-trigger.ps1 -Name StartupTriggerNTP
/run SendChatMessage(GetRandomArgument("Bombidum..","Hop along, my hearties!","Wake now my merry lads!","Merry dol! Derry dol! My darling!", "Tom Bom, jolly Tom, Tom Bombadillo!"),"SAY")
@JonathanMH
JonathanMH / index.js
Created October 22, 2016 15:07
JSON Web Token Tutorial: Express
// file: index.js
var _ = require("lodash");
var express = require("express");
var bodyParser = require("body-parser");
var jwt = require('jsonwebtoken');
var passport = require("passport");
var passportJWT = require("passport-jwt");