Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am treevs on github.
  • I am treevs (https://keybase.io/treevs) on keybase.
  • I have a public key whose fingerprint is 0DCA BF59 8902 A4F0 9E92 D7EE 2841 77CE E590 CB4F

To claim this, I am signing this object:

import requests
payload = {'type': 'all-meat', 'paras': '3', 'sentences': '30', 'start-with-lorem': '1', 'format': 'json'}
r = requests.get('http://baconipsum.com/api', params=payload)
print (r.json())
@Treevs
Treevs / gist:ff95009c5a455b3c8e3c
Created May 6, 2015 23:03
Hexchat script test
__module_name__ = "test"
__module_version__ = "1.0"
__module_description__ = "Python module test"
import hexchat
channel = "#foo"
username = "bar"
@Treevs
Treevs / Grade Calculator With Switch Statement
Last active August 29, 2015 14:15
My friend didn't think making an ABCDF grade calculator was possible taking a percentage (simplified without the percentage sign) and using a switch statement without making multiple cases
<?php
function gradeSwitch($var) {
$var2 = (int)($var/10);
echo $var." is a(n)";
switch($var2) {
case 10:
case 9:
echo "A";
break;