Skip to content

Instantly share code, notes, and snippets.

Arthur Nogueira Neves arthurnn

Block or report user

Report or block arthurnn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
arthurnn / gist:1064993
Created Jul 5, 2011
PIL error in MAC OS
View gist:1064993
Downloading/unpacking PIL
Running egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package names in
Installing collected packages: PIL
Running install for PIL
WARNING: '' not a valid package name; please use only.-separated package names in
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/arthurnn/Envs/myblog/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _imaging.c -o build/temp.macosx-10.6-universal-2.6/_imaging.o
_imaging.c:3017: warning: initia
arthurnn /
Created Jul 24, 2011
threadless wallpaper
from PIL import Image
import urllib
import cStringIO
import re
import sys
URL = sys.argv[1]
ratio = 1
size = (1440,900)
arthurnn / gist:1112592
Created Jul 28, 2011
View gist:1112592
/* only output for valid = true */
interface FilterIterator {
public boolean hasNext();
public Object next();
interface Filter {
boolean valid(Object o);
View gist:1204385
<script src="//"></script>
var json_Album_URI = ""
+ "user/" + "thewoodsmyth"
+ "?alt=" + "json"
+ "&kind=" + "album"
arthurnn /
Created Dec 2, 2011
Script to fetch and CBC rss feed and count the words
#!/usr/bin/env python
import threading,thread
from lxml import etree, html
import urllib
from StringIO import StringIO
# mapper function
def mapper(document):
words = document.split()
for w in words:
arthurnn /
Created Dec 3, 2011
This is the main file for Kik
package com.arthurnn;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import javax.xml.parsers.DocumentBuilder;
arthurnn /
Created Jan 23, 2012
Alphabet Soup solution for Facebook HackerCup
#!/usr/bin/env python
# encoding: utf-8
Created by @arthurnn
import sys
import os
import fileinput
arthurnn /
Created Feb 27, 2012
beaglebone PWM
from mmap import mmap
import struct
MMAP_OFFSET = 0x44c00000 # base address of registers
MMAP_SIZE = 0x48ffffff-MMAP_OFFSET # size of the register memory space
CM_PER_BASE = 0x44e00000 - MMAP_OFFSET
View robot
# -- must be run as root
import time
# put Port 8 Pin 3 into mode 7 (GPIO)
open('/sys/kernel/debug/omap_mux/gpmc_ad6', 'wb').write("%X" % 7)
# put Port 8 Pin 4 into mode 7 (GPIO)
open('/sys/kernel/debug/omap_mux/gpmc_ad7', 'wb').write("%X" % 7)
# Port 9 pin Pin 14 (EHRPWM1A)
open('/sys/kernel/debug/omap_mux/gpmc_a2', 'wb').write("%X" % 6)
arthurnn / gist:2969703
Created Jun 22, 2012
Fetch Movies for ios5
View gist:2969703
- (void)fetchMovies
__block NSString * url = @"";
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]];
[request setHTTPMethod:@"GET"];
NSHTTPURLResponse *response;
NSError *error = nil;
You can’t perform that action at this time.