Skip to content

Instantly share code, notes, and snippets.

View luisnaranjo733's full-sized avatar

Luis Naranjo luisnaranjo733

View GitHub Profile
@luisnaranjo733
luisnaranjo733 / nb2html.py
Created May 16, 2012 00:29 — forked from fperez/nb2html.py
First draft of an ipython notebook html exporter for blogger
#!/usr/bin/env python
"""A really simple notebook to rst/html exporter.
Usage
./nb2html.py file.ipynb
Produces 'file.rst' and 'file.html', along with auto-generated figure files
called nb_figure_NN.png.
@luisnaranjo733
luisnaranjo733 / define.py
Created September 2, 2012 22:25
A command line dictionary wrapper over the wordnik API
#!/usr/bin/env python
'''
I frequently look up word meanings online.
It's kind of a hassle to fire up the browser, and search online after a while.
It's a lot easier for me to do it from the command line, when my terminal is one keyboard shortcut away.
I wrote this script using the wordnik api that does just that.
I suggest you put this somewhere in your PATH, make it executable.
Make sure you get a Wornik API key at http://developer.wordnik.com/
@luisnaranjo733
luisnaranjo733 / docker-compose.yml
Created March 29, 2017 01:00
Docker compose file
version: '2'
services:
nginx:
image: nginx:latest
container_name: ng01
ports:
- "8000:8000"
volumes:
- ./src:/src
- ./config/nginx:/etc/nginx/conf.d
FROM node:6.10.1
RUN mkdir /src;
WORKDIR /src
@luisnaranjo733
luisnaranjo733 / web.Dockerfile
Created March 29, 2017 01:07
web dockerfile
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN mkdir /config
ADD /config/requirements.txt /config/
RUN pip install -r /config/requirements.txt
RUN mkdir /src;
WORKDIR /src
@luisnaranjo733
luisnaranjo733 / example.js
Created April 24, 2017 01:47
How to make POST requests in JS
let data = new FormData();
data.append('note', 'new note value yo!');
let youth_visit_id = 1;
let url = `/api/visit/${youth_visit_id}/edit-note/`;
fetch(url, {
method: 'POST',
body: data
}).then(response => {
@luisnaranjo733
luisnaranjo733 / .block
Created May 16, 2017 20:01 — forked from mbostock/.block
Choropleth
license: gpl-3.0
height: 600
border: no
@luisnaranjo733
luisnaranjo733 / docker-compose.yml
Created May 19, 2017 17:21
docker-compose.yml
version: '2'
services:
nginx:
image: nginx:latest
container_name: ng01
ports:
- "80:80"
volumes:
- ./src:/src
- ./config/nginx:/etc/nginx/conf.d
@luisnaranjo733
luisnaranjo733 / django.conf
Created May 19, 2017 17:23
Nginx config file
upstream web {
ip_hash;
server web:80;
}
# portal
server {
location /static/ {
autoindex on;
alias /static/;
@luisnaranjo733
luisnaranjo733 / adjust.d.ts
Created September 29, 2018 00:52
Example typings for Adjust RN SDK
declare module "react-native-adjust" {
type Environment = "sandbox" | "production";
export class AdjustConfig {
constructor(appToken: string, environment: Environment) {}
static get EnvironmentSandbox(): Environment {
return "sandbox";
}
static get EnvironmentProduction(): Environment {