Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastián Magrí sebasmagri

View GitHub Profile
View rust-meetups-curated.json
[
{
"id": 10495542,
"organizer": {
"id": 71636602,
"name": "Erick Tryzelaar",
"url": "https://www.meetup.com/members/71636602"
},
"url": "https://www.meetup.com/Rust-Bay-Area/"
},
View keybase.md

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 Nov 10, 2014
Concurrently streaming response using Falcon and Gevent
View falcon_gevent_streaming.py
# 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
View gist:9b42683a104013e94bb5
Verifying that +sebasmagri is my Bitcoin username. You can send me #bitcoin here: https://onename.io/sebasmagri
@sebasmagri
sebasmagri / urlquote
Created Jun 18, 2014
Simple script to encode a string to be used in URLs
View urlquote
#!/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 Nov 12, 2015
Set Emacs executables PATH to the one used by interactive shells
View emacs-path-from-interactive-shell.el
;;; 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)))