Skip to content

Instantly share code, notes, and snippets.

View RobbieClarken's full-sized avatar
🦀

Robbie Clarken RobbieClarken

🦀
View GitHub Profile
@RobbieClarken
RobbieClarken / demo.js
Created February 9, 2018 07:44
JavaScript binding demo
/*
To run, save as demo.js in an empty folder and then run:
yarn add babel-cli babel-plugin-transform-class-properties
./node_modules/.bin/babel-node --plugins transform-class-properties demo.js
*/
" Try out different colours
let x=0
nnoremap <Left> :let x-=1 \| exe 'highlight CursorLine cterm=NONE ctermbg='.x \| echo x<cr>
nnoremap <Right> :let x+=1 \| exe 'highlight CursorLine cterm=NONE ctermbg='.x \| echo x<cr>
from urllib.request import urlopen
from urllib.parse import urljoin, unquote_plus
import re
from random import choice
from bs4 import BeautifulSoup
BASE_URL = 'https://en.wikipedia.org/'
import sys
from select import select
import tty
import termios
import atexit
def disable_line_buffering():
original_tty_attrs = termios.tcgetattr(sys.stdin)
#!/bin/bash
main () {
print_runtime > /dev/null
print_runtime
}
print_runtime () {
pid=$(start_server)
runtime=$(time_command wait_for_server)
@RobbieClarken
RobbieClarken / statistics.sh
Created August 9, 2016 22:39
Statistics script from raptor
#!/bin/bash
start=$1
end=$2
run() {
echo "Hash,XXX Count,Require Time,Ping Time,Prod Lines,Spec Lines,Spec Count,Spec Runtime,Spec End-to-End,Test doubles"
full_command="echo $hash,$xxx_count,$require_time,$ping_time,$prod_lines,$spec_lines,$spec_count,$spec_runtime,$spec_end_to_end,$test_doubles"
$(dirname $0)/run-command-on-git-revisions -v $start $end "$full_command"
}

On the host machine:

mkdir ioc
docker run -it --name detector \
           -v "$PWD/ioc":/ioc \
           -e USER=root \
           -w /ioc \
           -p 8081:8081 \
 -p 5064:5064 \
@RobbieClarken
RobbieClarken / pipista.py
Last active June 15, 2016 09:50 — forked from pudquick/pipista.py
pipista - pip module (for installing other modules) for Pythonista
from __future__ import print_function
import os, os.path, sys, urllib2, requests
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def _chunk_report(bytes_so_far, chunk_size, total_size):
sudo apt -y install dist-upgrade
sudo reboot
sudo apt -y upgrade
sudo apt -y install vim-nox tmux openssh-server
sudo apt -y install nvidia-361  # If you have an NVIDIA GPU
sudo reboot
sudo apt -y install aria2  # fast, resumable downloads