Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tscho on github.
  • I am ad_tscho (https://keybase.io/ad_tscho) on keybase.
  • I have a public key ASB-2Txs1bAOnyNmhVXUnPzM6IYi0tzF-jP7Jyriv6LKjAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am tscho on github.
  • I am schwap (https://keybase.io/schwap) on keybase.
  • I have a public key whose fingerprint is 2531 E933 E5D8 0554 F570 D354 C0EA 9B0E 7E23 63AF

To claim this, I am signing this object:

@tscho
tscho / Marks.js
Last active December 12, 2015 10:38
var MaxNum = 0;
var MinNum = 10000000000;
var count = 0
while (count < 6) {
print ("please enter a number");
var num1 = getInput
num1 = parseFloat (num1)
if (num1 > MaxNum{
Maxnum = num1
@tscho
tscho / linkedlist.c
Created January 12, 2012 21:47
It's a linked list. Of numbers. Yay. At least it can reverse itself in O(N) time.
#include <stdio.h>
#include <stdlib.h>
#define null 0
typedef struct _node {
int value;
struct _node *next;
} node;
enum FileState {
NEW {
FileState pass() { return DOWNLOADING; }
FileState fail() { return NEW; }
},
DOWNLOADING {
FileState pass() { return PROCESSING; }
FileState fail() { return DLFAILED; }
},
DLFAILED {
@tscho
tscho / weatherclutter.js
Created May 17, 2011 15:26
GreaseMonkey script to cleanup weathernetwork pages
// ==UserScript==
// @name weatherclutter
// @namespace asd
// @include http://www.theweathernetwork.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js
// ==/UserScript==
$("embed:not(#twn14day)").remove();
$("#ugc").remove();
$("#wrap_ccb").remove();
@tscho
tscho / unix_client.c
Created May 11, 2010 17:48
Example unix socket client
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int sockfd, t, len;
@tscho
tscho / unix_server.c
Created May 11, 2010 16:57
An example of a unix socket echo server that can run as a daemon
#include <signal.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include <sys/un.h>
#include <errno.h>
#include <sys/signal.h>
#include <wait.h>
@tscho
tscho / weather.rb
Created February 18, 2010 18:30
Parses the @WeatherCalgary twitter feed and uses the google chart API to create a png temperature graph
#!/usr/local/bin/ruby
require 'rubygems'
require 'uri'
require 'net/http'
require 'json' #3rd party
require 'time'
def weird_parse(weird)
slices = weird.split /[\s]/