Skip to content

Instantly share code, notes, and snippets.

View effects.vala
// Prototype code - Messy, Undocumented and Will crash at some point
// Pipeline: fakevideosrc -> (effects loaded from the files specified in commandline) -> ogg output
// Compile: valac --pkg gstreamer-0.10 --pkg gee-1.0 effects.vala
// Run: ./effects output.ogg noir.effect warptv.effect
// Author: Yuvi Panda (me@yuvi.in)
using Gst;
using GLib;
using Gee;
View colorspaceconvertor.c
// Author: Unkown
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
void main()
{
int gd=DETECT,gm,n;
float r=0,g=0,b=0;
float y=0,i=0,q=0;
View gist.php
<?php
/**
* Gist Command - Easy way to embed a gist in Dokuwiki
* Usage: %gist(gist_id)%
* @license Three Clause BSD
* @author Yuvi Panda (http://yuvi.in)
*/
class CommandPluginExtension_gist extends CommandPluginExtension
{
View nqueens.py
from math import *
import sys
x = {}
n = int(sys.argv[1])
def place(k, i):
if (i in x.values()):
return False
j = 1
View Makefile.am
VALA_CFLAGS = \
--thread \
--vapidir vapi \
--pkg config \
--pkg gtk+-2.0
AM_CPPFLAGS = \
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\" \
-DPREFIX=\""$(prefix)"\" \
View json-format.l
// Lex program to pretty-format json file. ***WARNING-Amateurish***
%{
int string=0;
int gi=0;
void indent(int i);
int prev_close=0;
%}
%%
\\\" { //Matching an escaped double quote
View hopeless-romantic.post
Hopeless Romantic?
tags: love, hopeless
She was going out of town that night. Ten days of fun with family, in a hill station far far away. He could text her, but she obviously wouldn't text back. He wasn't worth the 1.5 bucks per message that vodafone charged.
He had work to do. But he also wanted to do something to surprise her before she left. Something that could be called romantic. Something more than just a "Have fun, be safe" message. Something that would make her remember him. Something that would let her know how he felt about her.
His mind was racing. Maybe he could break into the railway station's PA system and proclaim his love for her over the loud speakers? He killed the idea - her family would be around, she would get increidibly pissed off, and worst of all - he might go to jail. Maybe he could find someone to sell him a ticket in the same compartment she was travelling in. While incredibly exciting to think about, it fell flat since both their parents will kill them, and he would have to wa
View clutter-vala.c
/* clutter-vala.c generated by valac, the Vala compiler
* generated from clutter-vala.vala, do not modify */
#include <glib.h>
#include <glib-object.h>
#include <clutter/clutter.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
View Makefile.am
INCLUDES = \
-DDATADIR=\"$(datadir)\" \
-DPREFIX=\""$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DPACKAGE_DATADIR=\""$(datadir)/cheese"\" \
-DPACKAGE_LOCALEDIR=\""$(datadir)/locale"\" \
-DAPPNAME_DATA_DIR=\"$(pkgdatadir)\" \
-DGNOME_DESKTOP_USE_UNSTABLE_API=1 \
$(CHEESE_CFLAGS)
View irclogger.py
#!/usr/bin/python
# IRC Logger.
# By Shashi Gowda <http://identi.ca/shashi>.
import sys
import socket
import time
import os