This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.7 | |
import argparse | |
def get_temperature(): | |
with open('/sys/class/thermal/thermal_zone0/temp', 'r') as f: | |
return float(f.read()) / 1000.0 | |
def celsius_to_fahrenheit(c): | |
return 32 + 1.8*c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import os, requests, sys, urllib.parse | |
def get_landing_links(url): | |
r = requests.get(url) | |
r.raise_for_status() | |
html = BeautifulSoup(r.text, features="html.parser") | |
table = html.find("table", id="songlist") | |
links = [] | |
for row in table.findAll("tr")[1:-1]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: | |
// click.m | |
// | |
// Found at: | |
// http://hints.macworld.com/article.php?story=2008051406323031 | |
// | |
// Compile with: | |
// gcc -o click click.m -framework ApplicationServices -framework Foundation | |
// | |
// Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Wave generator | |
* by Nathan Korth | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <math.h> | |
#include <string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html><canvas id="c"><script>var c=document.getElementById("c"),g=c.getContext("2d"),s=c.width=c.height=600,a=[],r=Math.random,v=["#f80","#0ff","#f5f"],f=function(){g.clearRect(0,0,s,s);if(a.length<12)a.push([r()*s,r()*s,r()*4-2,r()*4-2]);for(var i=0;i<a.length;i++){var j=a[i];if((i+1)%4==0){g.closePath();g.strokeStyle=v[(i-3)/4];g.stroke();g.beginPath();g.moveTo(j[0],j[1])}j[0]+=j[2];j[1]+=j[3];if(j[0]<1||j[0]>s)j[2]*=-1;if(j[1]<1||j[1]>s)j[3]*=-1;g.lineTo(j[0],j[1])}};setInterval(f,9)</script> |