Skip to content

Instantly share code, notes, and snippets.

View zokeber's full-sized avatar
🏠
Working from home

Daniel Lopez Monagas zokeber

🏠
Working from home
View GitHub Profile

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@zokeber
zokeber / opacity-hover.js
Created December 17, 2013 11:31
JQuery opacity hover
$(document).ready(function(){
$(".class").css("opacity","0");
$(".class").hover(function () {
$(this).stop().animate({
opacity: .7
}, "slow");
},
function () {
$(this).stop().animate({
opacity: 0
@zokeber
zokeber / static-django.py
Created December 17, 2013 11:18
Static path in Django
import os
PRO_PATH = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PRO_PATH, 'assets/static')
@zokeber
zokeber / highlight-pre.css
Created December 17, 2013 11:17
Pre css hightlight
div.highlight pre {
background-color: rgb(245, 245, 245);
font-family: 'Inconsolata',monospace;
font-size: 1.1em;
overflow: auto;
word-wrap: normal;
white-space: pre;
}
pre {
@zokeber
zokeber / bigsizeimgmixin.css
Created December 17, 2013 11:16
Big size image in background with mixin
html {
background: url(images/bg.jpg) no-repeat center center fixed;
background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
-webkit-background-size:cover;
-khtml-background-size:cover;
}
@zokeber
zokeber / gitio.md
Created December 17, 2013 11:15 — forked from myano/gitio.md

Create git.io Short URLs in Python

git.io is an awesome URL shortener provided by Github. It works when shortening URLs from *.github.com/* to a small http://git.io/ link.

requests

>>> import requests
package main
import (
"fmt"
"os"
"log"
"flag"
"image"
_ "image/gif"
"image/jpeg"
@zokeber
zokeber / uwsgi.init
Created November 19, 2013 14:11
uWsgi Centos 6
#!/bin/sh
# Autor: Nilton OS -- www.linuxpro.com.br
# Take from: https://gist.github.com/jniltinho/5565617
#
#
### BEGIN INIT INFO
# Provides: uwsgi
# Required-Start: $syslog $remote_fs
# Should-Start: $time ypbind smtp
# Required-Stop: $syslog $remote_fs
#!/bin/bash
# Autor: Nilton OS -- www.linuxpro.com.br
echo 'setup-web2py-nginx-uwsgi-centos64.sh'
echo 'Support CentOS 6.4'
echo 'Installs Nginx 1.4.1 + uWSGI + Web2py'
# Get Web2py Admin Password
echo -e "Web2py Admin Password: \c "
read PW
@zokeber
zokeber / populateMongoDB.js
Created September 1, 2013 08:26
Populate with collections of grades in MongoDB
use students;
for (i=0;i<10000;i++) { names=["exam","easy","quiz"]; for (j=0; j<3; j++) { db.scores.insert( { "student" : i, "type" : names[j], score : Math.round(Math.random()*100) } ); } };
exit;