Skip to content

Instantly share code, notes, and snippets.

📉
Learnin'

Joseph Redfern JosephRedfern

📉
Learnin'
Block or report user

Report or block JosephRedfern

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JosephRedfern
JosephRedfern / Speedtest
Last active Sep 16, 2015
Scaleway ARM machine
View Speedtest
root@beryllium:~# wget http://cachefly.cachefly.net/100mb.test
converted 'http://cachefly.cachefly.net/100mb.test' (ANSI_X3.4-1968) -> 'http://cachefly.cachefly.net/100mb.test' (UTF-8)
--2015-09-03 11:28:49-- http://cachefly.cachefly.net/100mb.test
Resolving cachefly.cachefly.net (cachefly.cachefly.net)... 62.210.187.96
Connecting to cachefly.cachefly.net (cachefly.cachefly.net)|62.210.187.96|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: '100mb.test'
100mb.test 100%[==========================================================================================================================================>] 100.00M 50.1MB/s in 2.0s
View gist:2639500
public class JoesJavaCoursework{
public static void main(String[] args){
new JoesJavaCoursework();
}
public JoesJavaCoursework(){
this.lolbox();
}
public void lolbox(){
@JosephRedfern
JosephRedfern / gist:2776271
Created May 23, 2012
cPanel public_html backup extractor
View gist:2776271
#!/bin/bash
#This script assumes that your cPanel backup tarball is in the same directory as your public_html folder
#It doesn't do any verification, and will just quit if something goes wrong (due to set -e).
#Use at your own risk!
set -e
echo "Extracting Backup! If you dont see the message: All done!, then something has gone wrong."
cd $1
tar -xf back*
View gist:2956289
  • Office 2011
  • Photoshop
  • TextMate
  • Google Chrome (or Chromium?)
  • Alfred
  • VLC Media Player
  • Twitter Client
  • Eclipse
  • Dropbox
  • Sparrow
@JosephRedfern
JosephRedfern / gist:3137970
Created Jul 18, 2012
Grade Workerouterer
View gist:3137970
modules = {"cm1101":0.0, "cm1102":0.0, "cm1103":0.0, "cm1201":0.0, "cm1202":0.0, "cm1203":0.0, "cm1205":0.0}
for module in modules:
modules[module]=float(raw_input("Grade for "+module+": "))
print "Overall Grade: "+str((20*(modules["cm1101"]+modules["cm1102"]+modules["cm1103"]+modules["cm1202"]+modules["cm1203"])+10*(modules["cm1201"]+modules["cm1205"]))/120.0)
@JosephRedfern
JosephRedfern / gist:3843353
Created Oct 6, 2012
Thermistor Read Function
View gist:3843353
//a = analog reading, b = formula paramater (beta value of thermistor), r = reference resistance, t = reference temperature, z = resistance of static resistor in potential divider circuit, vin = input voltage.
double ntcTemp(double a, double b, double r, double t, double z, double vin){
double vout = (vin*a)/1023.0;
double resistance = z/((vin)/(vout)-1);
return 1/((log(resistance/r)/b)+(1/t))-273.15;
}
View gist:3912286
import string
abc = string.lowercase
def calcword():
word = raw_input("Enter Word: ")
value = 0
for char in word:
value += abc.index(char.lower())+1
@JosephRedfern
JosephRedfern / 1. DecompilationTest.java
Last active Dec 1, 2015
dx variable name destruction
View 1. DecompilationTest.java
import java.util.Scanner;
public class DecompilationTest{
public int SomeField = 123;
public static void main(String args[]){
DecompilationTest dt = new DecompilationTest();
dt.SomeMethod();
}
View addsite.sh
#!/bin/bash
#path to folder containing folders referenced by nginx server blocks
SERVERPATH="/var/www"
#name of logs folder
LOGFOLDER="logs"
#name of www folder (i.e. folder where web files are held)
WWWFOLDER="public_html"
View .vimrc
"Enable Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"Vundles! Wo0oho0o!
Bundle 'gmarik/vundle'
Bundle 'kien/ctrlp.vim'
Bundle 'altercation/vim-colors-solarized'
Bundle 'vim-scripts/JavaScript-Indent'
Bundle 'jcf/vim-latex'
You can’t perform that action at this time.