Skip to content

Instantly share code, notes, and snippets.

View Lewiscowles1986's full-sized avatar

Lewis Cowles Lewiscowles1986

View GitHub Profile
say4n /
Last active October 23, 2016 15:34
Python basic time profiler

To use the profiler, just use import pyprofile and if the function to be profiled is named stupid_code use the profiler as follows

def stupid_code():
    # do something stupid here
say4n / LICENSE
Last active May 9, 2017 06:37
Just a plain simple boring xkcd comic downloader with download progress indicator.
Version 2, December 2004
Copyright (C) 2016 Sayan Goswami <>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
bigcalm / 48bit_test1.php
Created January 22, 2013 23:28
Create a 48bit integer suitable for use with pack() in PHP
$topUp = 100;
list($integerPart1, $integerPart2) = convertTo48bit($topUp);
$packedInteger = pack("vV", $integerPart1, $integerPart2);
echo json_encode($packedInteger) . "\n";
cole007 / freelance-2014.csv
Last active October 4, 2017 22:04
Freelance Rates 2014 (@asclearasmud)
Where are you based in the UK? How would you describe what you do? Is your primary skill set(s) How old are you? How many years have you been a web professional? How many years have you been freelance? What is your DAY (not hourly) rate? DAY RATE (clean) What is your HOUR (not daily) rate? HOUR RATE (clean) How do you primarily charge clients? Do you normally request a deposit before starting work on a project? Do you normally use a contract? Do you mostly work … What is the average value of projects you work on? What is your gender? Do you primarily charge a fixed rate or does your rate vary between clients? What is the average amount of time spent working on a project? How many projects do you tend to work on at any on time? What is your normal invoicing terms? Where do you primarily work? On average, how many hours a day do you normally work? On average, how many days a week do you normally work? Do you have an accountant? What accounting software do you use, if any? Accounting software (clean) Is fr
honktang / web-snippet-055 ( upload to Imgur in JavaScript)
Created June 14, 2017 06:14 — forked from achudars/web-snippet-055 ( upload to Imgur in JavaScript)
Use JavaScript to upload anonymously to Imgur using Imgur API and show the link to the file. Make sure your API key is valid and working!
function upload(file) {
var imageLink ="";
/* Is the file an image? */
if (!file || !file.type.match(/image.*/)) return;
var fd = new FormData();
fd.append("image", file); // Append the file
fd.append("key", "<Imgur API key>");
pushd .
cd $2
$1 --preserve-paths --relative-only $(find $dir/$3 -iname "*.gcda") >/dev/null
echo "#!/usr/bin/python
import json,sys,codecs
freekmurze / bookmarklet
Last active February 22, 2019 10:13
Oh Dear! Reachable bookmarklet
Lewiscowles1986 /
Last active September 3, 2019 23:31
install ralink 7601U USB N+150 wireless driver (Ubuntu 14.04 or Kernel 3.13+)
#setup dependencies
sudo apt-get install --reinstall linux-headers-generic build-essential
#get patched drivers
wget -O - | tar -x
cd MT7601U-14.04-patched
# build and install
node {
bitbucketStatusNotify(buildState: 'INPROGRESS')
ws("${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/") {
withEnv(["GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}"]) {
johnmcfarlane / functor.c
Last active May 3, 2020 17:08
Illustrates run-time polymorphism in C
// functor.c : Illustrates run-time polymorphism in C.
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
// APIs