Skip to content

Instantly share code, notes, and snippets.

View paulproteus's full-sized avatar

Asheesh Laroia paulproteus

View GitHub Profile
;; code checking via pyflakes+flymake
(when (load "flymake" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "pyflakes" (list local-file))))
#! /usr/bin/perl
# Copyright (C) 2011
# Jérémie Nikaes <jeremie.nikaes@ensimag.imag.fr>
# Arnaud Lacurie <arnaud.lacurie@ensimag.imag.fr>
# Claire Fousse <claire.fousse@ensimag.imag.fr>
# David Amouyal <david.amouyal@ensimag.imag.fr>
# Matthieu Moy <matthieu.moy@grenoble-inp.fr>
# License: GPL v2 or later
$ pip install --user etsy
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 134, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1085, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 245, in find_requirement
➜ n_and_s cat gen.py
def to_n_and_s(i):
x = bin(i)
assert x.startswith('0b')
x = x[2:]
x = x.replace('1', 'n\n')
x = x.replace('0', 's\n')
x += 'c\n'
return x
def to_n_and_s(i):
x = bin(i)
assert x.startswith('0b')
x = x[2:]
x = x.replace('1', 'n\\n')
x = x.replace('0', 's\\n')
x += 'c\\n'
return x
PREFIX = 'snns'
@paulproteus
paulproteus / input.txt
Last active August 29, 2015 14:03
input
s
n
n
s
s
n
n
n
n
n
#!/usr/bin/python
def process_filename(filename):
lines = open(filename).readlines()
return process_string(lines)
def process_string(lines):
# Find first line, rofl
output_index = None
for i, line in enumerate(lines):
(sqlobject)self@gregorian:~/projects/sqlobject$ python
Python 2.7.6 (default, Jan 11 2014, 14:34:26)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import absolute_import
>>> import main
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named main
>>> import sqlobject.main
@paulproteus
paulproteus / nginx-default
Created April 17, 2015 20:27
Sandstorm + nginx, just http (no https)
# This is an example nginx config used to serve your Sandstorm server without SSL/TLS.
#
# Definitions like these should go in the "http" block of your nginx config.
# Configuration for Sandstorm shell.
server {
listen 80;
server_name localhost; # no need to customize this line
location / {
all: libintl.so hello
libintl.so:
gcc -c -Wall -Werror -fpic nothing.c
gcc -fpic -shared -o libintl.so nothing.c
hello:
LD_LIBRARY_PATH=. g++ -lintl hello.cxx
hello2: