Skip to content

Instantly share code, notes, and snippets.

View pansapiens's full-sized avatar

Andrew Perry pansapiens

  • Melbourne, Australia
View GitHub Profile
@darktable
darktable / minijsonjsdemo.js
Created August 30, 2012 21:54
Unity3D: Example of using MiniJSON in UnityScript (JavaScript).
#pragma strict
import MiniJSON;
import System.Collections.Generic;
function Start () {
var jsonString = "{ \"array\": [1.44,2,3], " +
"\"object\": {\"key1\":\"value1\", \"key2\":256}, " +
"\"string\": \"The quick brown fox \\\"jumps\\\" over the lazy dog \", " +
"\"unicode\": \"\\u3041 Men\\u00fa sesi\\u00f3n\", " +
"\"int\": 65536, " +
@vibragiel
vibragiel / duptools-gdrive.sh
Last active August 25, 2017 21:46 — forked from tsileo/duptools.sh
An example on how to use duplicity to perform encrypted incremental backups on Google Drive. Changes over tileo's original script: Google Drive instead of S3 as backend storage. Zenity dialogs to ask for credentials. IGNORE variable to exclude a list of directories from the backup. Verbosity raised to level 8. Activated asynchronous uploads.
#!/bin/bash
# directories to be included, space separated
SOURCE="/home/chewie /etc"
# directories to be excluded, space separated
IGNORE="/home/chewie/Downloads /home/chewie/Steam"
DRIVE_FOLDER="duplicity-backup"
LOGFILE=/home/chewie/duplicity.log
# set email to receive a backup report
EMAIL=""
@moonwatcher
moonwatcher / bcl2fastq_setup.sh
Last active January 6, 2018 20:29
bcl2fastq setup protocol
#!/bin/sh
# Protocol for setting up an environemnt for bcl2fastq 1.8.4
# See: http://seqanswers.com/forums/showpost.php?p=141026&postcount=29
# lior.galanti@nyu.edu
# for bcl2fastq2 see http://backwardincompatible.com/post/169360794395/compiling-illumina-bcl2fastq-220-on-ubuntu-with
# On Ubuntu
sudo apt-get install \
libexpat1-dev \
libexpat1 \
@vsoch
vsoch / Singularity.spec
Created March 3, 2018 14:57
A DeepVariant image for Singularity, reliant on a localimage pull of layers first
Bootstrap: localimage
From: /home/vanessa/.singularity/shub/deepvariant-docker-deepvariant:0.5.0.simg
# sregistry get gcr.io/deepvariant-docker/deepvariant:0.5.0
# sudo singularity build deepvariant Singularity
%environment
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DV_GPU_BUILD=0
export PATH DV_GPU_BUILD
@gladiatr72
gladiatr72 / 99-salt-minion-init.py
Last active February 26, 2020 20:12
IPython - saltstack profile initializers
# similar initializer for minion-side testing
import salt.config
import salt.client
import salt.loader
import salt.utils.minion as Minion_Util
import salt.config
import pprint
pp_ = pprint.PrettyPrinter(indent=4, depth=20)
pp = pp_.pprint
@Bklyn
Bklyn / chmodsym.py
Created August 16, 2016 13:27
Symbolic chmod in Python
# Found on https://www.daniweb.com/programming/software-development/code/243659/change-file-permissions-symbolically-linux
""" module chmodsym.py (linux)
This module defines a function chmod(location, description)
which allows to change a file's permission with a symbolic
description of the mode, similar to the shell command 'chmod'.
Tested with python 2.6 and 3.1.
"""
import os, stat
import functools
@fnl
fnl / skript.py
Created June 28, 2015 12:16
Python 3 script/command-line skeleton
#!/usr/bin/env python3
"""
Description
"""
from argparse import ArgumentParser
import logging
import os
import sys
from somewhere import main
@robertpyke
robertpyke / _instructions.md
Last active March 10, 2021 06:41
Interfacing with Nectar's Object Store (swift - Nectar's S3 equivalent)

How to get firmware onto mutable modules

I had the best luck with the Black Magic Probe and gdb.

Install compiler

First install the arm compiler:

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
@cjdd3b
cjdd3b / fingerprint.py
Created February 22, 2015 14:17
Python implementation of Google Refine fingerprinting algorithms here: https://github.com/OpenRefine/OpenRefine/wiki/Clustering-In-Depth
# -*- coding: utf-8 -*-
import re, string
from unidecode import unidecode
PUNCTUATION = re.compile('[%s]' % re.escape(string.punctuation))
class Fingerprinter(object):
'''
Python implementation of Google Refine fingerprinting algorithm described here: