Skip to content

Instantly share code, notes, and snippets.

View sebasmagri's full-sized avatar

Sebastián Magrí sebasmagri

View GitHub Profile
@sebasmagri
sebasmagri / rust-meetups-curated.json
Created April 19, 2017 16:17
Meetup.com Rust Meetups
[
{
"id": 10495542,
"organizer": {
"id": 71636602,
"name": "Erick Tryzelaar",
"url": "https://www.meetup.com/members/71636602"
},
"url": "https://www.meetup.com/Rust-Bay-Area/"
},

Keybase proof

I hereby claim:

  • I am sebasmagri on github.
  • I am sebasmagri (https://keybase.io/sebasmagri) on keybase.
  • I have a public key whose fingerprint is 651C 4E90 1944 47D9 4EA3 39E7 198B DC52 AF46 96A8

To claim this, I am signing this object:

@sebasmagri
sebasmagri / falcon_gevent_streaming.py
Created November 10, 2014 13:08
Concurrently streaming response using Falcon and Gevent
# Fire this using gunicorn falcon_gevent_streaming
# and head to 127.0.0.1:8000 in a browser.
# Requirements:
# pip install falcon gevent
import falcon
import gevent
from gevent.queue import Queue
Verifying that +sebasmagri is my Bitcoin username. You can send me #bitcoin here: https://onename.io/sebasmagri
@sebasmagri
sebasmagri / urlquote
Created June 18, 2014 13:32
Simple script to encode a string to be used in URLs
#!/usr/bin/env python3
import argparse
from urllib.parse import quote, quote_plus
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Encodes a string to be used in URLs',
@sebasmagri
sebasmagri / emacs-path-from-interactive-shell.el
Last active November 12, 2015 12:54
Set Emacs executables PATH to the one used by interactive shells
;;; Put this in your .emacs file.
;;; PATH used by default in emacs is not that used in interactive shells. Thus, it would miss
;;; paths set in the shell's rc file.
;;; The login shell could print warnings or errors on initialization, so we isolate the PATH and
;;; use a simple regexp to get the real value
(let ((interactive-shell-path (shell-command-to-string "$SHELL -l -i -c 'echo \"***\n$PATH\n***\"'")))
(string-match ".*\\*\\*\\*\\\n\\(.*\\)\n\\*\\*\\*.*" interactive-shell-path)
(let ((clean-shell-path (match-string 1 interactive-shell-path)))