Skip to content

Instantly share code, notes, and snippets.

View pridkett's full-sized avatar
🕺
Rockin the town like a moldy cruton!

Patrick Wagstrom pridkett

🕺
Rockin the town like a moldy cruton!
View GitHub Profile
@revolunet
revolunet / lzw_encoder.js
Created February 25, 2011 14:55
LZW javascript compress/decompress
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
var out = [];
var currChar;
var phrase = data[0];
var code = 256;
for (var i=1; i<data.length; i++) {
currChar=data[i];
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@masayukig
masayukig / com.crashplan.engine.plist.diff
Created November 9, 2012 17:02
Getting CrashPlan to work on Mac after JDK 1.7 upgrade
diff --git a/com.crashplan.engine.plist b/com.crashplan.engine.plist
index d536a84..d189347 100644
--- a/com.crashplan.engine.plist
+++ b/com.crashplan.engine.plist
@@ -22,7 +22,7 @@
<string>/Applications/CrashPlan.app/Contents/Resources/Java</string>
<key>ProgramArguments</key>
<array>
- <string>/usr/bin/java</string>
+ <string>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>
@willurd
willurd / web-servers.md
Last active October 18, 2024 12:42
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@dalelane
dalelane / .eslintrc
Last active October 26, 2015 18:14
.eslintrc
{
"env" : {
"node": true
},
"rules" : {
"strict": [2, "global"],
"quotes": [1, "single"],
"key-spacing": [1, { "beforeColon" : true, "afterColon" : true }],
@amercier
amercier / synology-scheduled-tasks.md
Last active July 28, 2024 22:33
Turn leds on/off on Synology DiskStation

Synology scheduled tasks

Usage

Go to Control Panel / Task Scheduler and add the content of these scripts as root scripts.

Leds

@germanattanasio
germanattanasio / create-classifier.js
Last active August 29, 2015 14:27
How to create a classifier using the nodejs wrapper
'use strict';
var watson = require('../nodejs-wrapper/lib/index');
var fs = require('fs');
var natural_language_classifier = watson.natural_language_classifier({
url: 'https://gateway.watsonplatform.net/natural-language-classifier/api',
username: 'USERNAME',
password: 'PASSWORD',
version: 'v1'
@erikbern
erikbern / install-tensorflow.sh
Last active June 26, 2023 00:40
Installing TensorFlow on EC2
# Note – this is not a bash script (some of the steps require reboot)
# I named it .sh just so Github does correct syntax highlighting.
#
# This is also available as an AMI in us-east-1 (virginia): ami-cf5028a5
#
# The CUDA part is mostly based on this excellent blog post:
# http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/
# Install various packages
sudo apt-get update
@kazeto
kazeto / tsv-mode.el
Created August 2, 2018 08:21
Emacs mode for TSV files.
;;; -------- TSV mode --------
(defface my-face-tsv-tab '((t (:background "black" :foreground "black"))) "Face for tabs in TSV.")
(defvar my-face-tsv-tab 'my-face-tsv-tab)
(defface my-face-tsv-2 '((t (:foreground "blue"))) "Face for 2nd column in TSV.")
(defvar my-face-tsv-2 'my-face-tsv-2)
(defface my-face-tsv-3 '((t (:foreground "yellow"))) "Face for 3rd column in TSV.")
(defvar my-face-tsv-3 'my-face-tsv-3)
@catchdave
catchdave / replace_synology_ssl_certs.sh
Last active October 12, 2024 15:41
CLI script to programmatically replace SSL certs on Synology NAS
#!/bin/bash
#
# *** For DSM v7.x ***
#
# How to use this script:
# 1. Get your 3 PEM files ready to copy over from your local machine/update server (privkey.pem, fullchain.pem, cert.pem)
# and put into a directory (this will be $CERT_DIRECTORY).
# Personally, I use this script (https://gist.github.com/catchdave/3f6f412bbf0f0cec32469fb0c9747295) to automate steps 1 & 4.
# 2. Ensure you have a user setup on synology that has ssh access (and ssh access is setup).
# This user will need to be able to sudo as root (i.e. add this line to sudoers, <USER> is the user you create):