Skip to content

Instantly share code, notes, and snippets.

quine.small.asm: quine.asm
python convert.py human_to_small
quine.bin: quine.asm
nasm -f bin -o quine.bin quine.asm
floppy: quine.bin
dd status=noxfer conv=notrunc if=quine.bin of=floppy
emu: floppy
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Way to insert image on a webpage.</h1>
<b><i><p>Below is a image :-</b></i></p>
<img src="http://1.bp.blogspot.com/-miqmqC8clI8/Ufixy7CFccI/AAAAAAAAADU/PdhBFd1Xwtg/s320/engagelikeusonfacebook.jpg" alt="Programming Skills" width="500px" height="500px">
</body>
@philipcristiano
philipcristiano / faces_example.py
Created June 18, 2013 14:10
Resize and crop an image based on OpenCV detected faces
import sys
from PIL import Image, ImageDraw
try:
import cv
except ImportError:
print 'Could not import cv, trying opencv'
import opencv.cv as cv
@harthur
harthur / orientation.js
Created June 2, 2013 20:59
Firefox scratchpad for simulating `deviceorientation` events
/*
* Run this in a Firefox "Scratchpad" (Tools > Web Developer > Scratchpad)
* With Cmd-R to simulate an orientation event in the current page
*/
function simulateOrientation(alpha, beta, gamma) {
var event = document.createEvent("DeviceOrientationEvent");
event.initDeviceOrientationEvent('deviceorientation',
true, true, alpha, beta, gamma, true);
@inactivist
inactivist / tweepy_raw_response_json.py
Last active December 26, 2020 12:11
How to get the raw Twitter API JSON response from a Tweepy request. It provides a simple way to stash the parsed API request results for later use. It stores the parsed JSON in a _payload field in the returned API results, which can then be iterated over. Not as clean as I'd like, but it allows me to leverage all of Tweepy's API methods and stil…
"""
Taken from my suggestion at:
https://groups.google.com/forum/#!msg/tweepy/OSGRxOmkzL4/yaNT9fL9FAIJ
Note that this is an incomplete snippet; you'll need to create the API auth object.
"""
import simplejson as json
import tweepy
;
; Selfer.
;
; Shikhin Sethi, the author of selfer, has dedicated the work to the public domain
; by waiving all of his or her rights to the work worldwide under copyright law,
; including all related and neighboring rights, to the extent allowed by law.
;
; You can copy, modify, distribute and perform the work, even for commercial purposes,
; all without asking permission.
;
@shikhin
shikhin / Selfer.asm
Last active December 15, 2015 00:59
Following is Selfer, which is an attempt at a stand-alone system to create, well, new systems!
;
; Selfer.
;
; Shikhin Sethi, the author of selfer, has dedicated the work to the public domain
; by waiving all of his or her rights to the work worldwide under copyright law,
; including all related and neighboring rights, to the extent allowed by law.
;
; You can copy, modify, distribute and perform the work, even for commercial purposes,
; all without asking permission.
;
@cuixin
cuixin / csv.lua
Created March 14, 2013 07:39
Using lua to parse CSV file to a table.
-- Using lua to parse CSV file to a table.
-- Notice: first line must be data description filed.
-- The separator is '|', change it if you want.
-- Usage: csv = require('csv')
-- tab = csv.load('test.csv', ',')
-- table.foreach(tab[1], print)
-- print(tab[1].you_field)
--encoding=utf-8
@dbrockman
dbrockman / degrees-radians.h
Created February 12, 2013 21:52
Convert degrees <-> radians C macros
// Converts degrees to radians.
#define degreesToRadians(angleDegrees) (angleDegrees * M_PI / 180.0)
// Converts radians to degrees.
#define radiansToDegrees(angleRadians) (angleRadians * 180.0 / M_PI)
@chrisguitarguy
chrisguitarguy / bubble_sort.c
Last active December 11, 2015 22:29
Bubble Sort
// Bubble Sort
// http://en.wikipedia.org/wiki/Bubble_sort
// Christopher Davis 2013
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
void swap(int *array, const unsigned int from, const unsigned int to)
{
int tmp;