Skip to content

Instantly share code, notes, and snippets.

@jacktasia
jacktasia / A systemverilog dumb-jump test
Last active May 12, 2018 15:29
A systemverilog dumb-jump test
# dummy file
@jacktasia
jacktasia / ImgixPurgeExample.java
Created February 20, 2015 01:44
imgix Java purge example (1.8 w/o dependencies)
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.net.ssl.HttpsURLConnection;
import java.net.URL;
import java.util.Base64;
import java.io.OutputStream;
public class ImgixPurgeExample {
@jacktasia
jacktasia / imgix_purge.php
Created January 4, 2015 01:45
imgix PHP purge example
<?php
// find your api key on the bottom of page @ https://webapp.imgix.com
define('IMGIX_API_KEY', '');
// pass the url you want to purge
function imgix_purge($url) {
$headers = array(
'Content-Type:application/json',
'Authorization: Basic '. base64_encode(IMGIX_API_KEY.':')

Keybase proof

I hereby claim:

  • I am jacktasia on github.
  • I am jack (https://keybase.io/jack) on keybase.
  • I have a public key whose fingerprint is 5810 04B5 0B06 B765 0F82 2F33 2FC5 F3ED 263E A8ED

To claim this, I am signing this object:

@jacktasia
jacktasia / test.clj
Created October 25, 2013 22:00
Pretty print clojure code
(use 'clojure.pprint)
(require ' [clojure.edn :as edn])
(let [file-contents (slurp "clojure_test2.clj")
process-file (with-out-str
(clojure.pprint/write
(edn/read-string (str "[" file-contents "]"))
:dispatch
clojure.pprint/code-dispatch))]
(println (subs process-file 1 (- (.length process-file) 1))))
@jacktasia
jacktasia / ai-auto-save.py
Created August 30, 2013 00:19
auto-save illustrator every 60 seconds (mac only)
import os
import time
import subprocess
def is_illustrator_open():
""" probably a better way to do this! """
ps = subprocess.Popen(['ps', 'ax'], stdout = subprocess.PIPE)
grep = subprocess.Popen(['grep', 'Adobe Ill'], stdin = ps.stdout, stdout = subprocess.PIPE)
wc = subprocess.Popen(['wc', '-l'], stdin = grep.stdout, stdout = subprocess.PIPE)
open = int(wc.communicate()[0])
@jacktasia
jacktasia / dotemacs24.el
Created June 17, 2012 21:02
.emacs for emacs 24
Moved this here: https://github.com/jacktasia/dotemacs24
@jacktasia
jacktasia / gist:966924
Created May 11, 2011 17:35
get pid of running
ps ax | grep [g]calc | ack-grep -oh '[0-9]{3,}'