This file contains hidden or 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
using Gtk; | |
using Soup; | |
using Json; | |
namespace Podcasts { | |
public class Application : Gtk.Window { | |
Gtk.Grid grid; | |
Soup.SessionAsync session; |
This file contains hidden or 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
//compile w ith valac --pkg gio-2.0 --pkg gdk-3.0 server.vala -o server && ./server | |
//deps: xdotool libgdk gio-2.0 | |
int cx = 0; | |
int cy = 0; | |
Gdk.Display display = null; | |
Gdk.Screen screen = null; | |
Gdk.Device pointer = null; |
This file contains hidden or 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
// gcc -o arrow arrow.c -lcurses | |
#include <curses.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
int ch = 0; | |
initscr(); | |
cbreak(); |
This file contains hidden or 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 BeautifulSoup import BeautifulSoup | |
from urllib2 import urlopen | |
def get_page(pageToScrape): | |
return urlopen(pageToScrape).read() | |
def main(): | |
pagesToScrape = ['http://example.com/data1/api.xml' , 'http://example.com/data2/api.xml'] | |
This file contains hidden or 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
BOLD=$(tput bold) | |
RESET=$(tput sgr0) | |
SOLAR_RED=$(tput setaf 1) | |
SOLAR_GREEN=$(tput setaf 2) | |
SOLAR_YELLOW=$(tput setaf 3) | |
SOLAR_BLUE=$(tput setaf 4) | |
SOLAR_MAGENTA=$(tput setaf 5) | |
SOLAR_CYAN=$(tput setaf 6) | |
SOLAR_WHITE=$(tput setaf 7) | |
SOLAR_ORANGE=$(tput setaf 4) |
This file contains hidden or 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
for fgbg in 38 48 ; do #Foreground/Background | |
for color in {0..256} ; do #Colors | |
#Display the color | |
echo -en "\e[${fgbg};5;${color}m ${color}\t\e[0m" | |
#Display 10 colors per lines | |
if [ $((($color + 1) % 10)) == 0 ] ; then | |
echo #New line | |
fi | |
done | |
echo #New line |
This file contains hidden or 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
// http://imgur.com/EKKMKNn | |
using Gtk; | |
class OptionBox : EventBox { | |
public signal void clicked (); | |
public OptionBox (string title, string info) { | |
var main_grid = new Grid (); | |
var title_label = new Label (null); | |
var info_label = new Label (info); |
This file contains hidden or 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
// valac --pkg vte-2.90 --pkg gtk+-3.0 test.vala | |
public class Wind { | |
GLib.Pid child_pid; | |
public Wind () { | |
var w = new Gtk.Window (); | |
w.set_size_request (640,480); | |
w.destroy.connect (Gtk.main_quit); | |
var ter = new Vte.Terminal (); | |
var dir = GLib.Environment.get_current_dir (); | |
ter.fork_command_full (Vte.PtyFlags.DEFAULT, dir, { Vte.get_user_shell () }, |
This file contains hidden or 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
/* | |
jsfiddle of the following code: http://jsfiddle.net/VGA82/ | |
*/ | |
(function(pt, undefined) { | |
pt.woah = 'public property'; | |
var woa = 'private property'; | |
This file contains hidden or 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
import os | |
import sys | |
import subprocess | |
import mimetypes | |
def get_mimetype(loc): | |
process = subprocess.Popen(['mimetype',loc], stdout=subprocess.PIPE) | |
output, err = process.communicate() | |
if err != None: |