Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
ipedrazas / gist:2550426
Created April 29, 2012 13:23
Nginx Server config
server {
listen 80 default;
root /var/www/blibb/php/public;
index index.php;
location /user/ {
try_files $uri $uri/ /main.php?id=$uri&$args;
}
@ipedrazas
ipedrazas / gist:2657460
Created May 11, 2012 04:05
Nice Paste on Vim
:set nosmartindent
:set noautoindent
i
<cmd>-v
<esc>
:set smartindent
:set autoindent
@ipedrazas
ipedrazas / new_gist_file
Created May 30, 2013 08:34
Ubuntu Gnome initial SetUp
#!/bin/bash
# apt-fast
printf "\n\ninstalling apt-fast repository\n"
sudo add-apt-repository -y ppa:apt-fast/stable
# tweaking tools
################
# ubuntu-tweak
@ipedrazas
ipedrazas / new_gist_file
Created June 16, 2013 20:30
Ansible to setup Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :private_network, ip: "192.168.111.222"
@ipedrazas
ipedrazas / new_gist_file
Created June 19, 2013 16:23
Maven Settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>clinker</id>
'use strict';
function log(entry){
if( console && console.log ) {
console.log(entry);
}
}
@ipedrazas
ipedrazas / gist:8154292
Created December 28, 2013 00:00
Little script that extracts title, description and screenshot of the URL based on https://gist.github.com/juanriaza/8144461 by @juanriaza
# -*- coding: utf-8 -*-
import os
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from pyvirtualdisplay import Display
# We use PyVirtualDisplay (a Python wrapper for Xvfb)
# to run headless WebDriver tests.
### Keybase proof
I hereby claim:
* I am ipedrazas on github.
* I am iv (https://keybase.io/iv) on keybase.
* I have a public key whose fingerprint is CF64 C5D1 AEA0 4B09 07C3 6C10 3669 7054 1D4F 3A80
To claim this, I am signing this object:
# run.py
from eve import Eve
import pdb
from worker import populate_dotmark
def after_insert(resource, items):
print "after insert"
for item in items:
url = item['url']
@ipedrazas
ipedrazas / run.py
Created May 1, 2014 09:12
flask + celery
from eve import Eve
import pdb
from worker import populate_dotmark
def after_insert(resource, items):
print "after insert"
for item in items: