Skip to content

Instantly share code, notes, and snippets.

View j0lvera's full-sized avatar
🎯
Focusing

Juan Olvera j0lvera

🎯
Focusing
View GitHub Profile
@j0lvera
j0lvera / functions.php
Created June 18, 2014 20:58
functions.php
<?php
/**
* _bitt functions and definitions
*
* @package _bitt
*/
/**
* Required: set 'ot_theme_mode' filter to true.
*/
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
var Options = React.createClass({
savePrice: function(price) {
localStorage.setItem("Price", price);
},
_renderOptions: function() {
return this.props.data.map(function(option) {
return (
<Option
price={option.price}
@j0lvera
j0lvera / app.py
Created May 26, 2014 18:17
seoapp
#!/usr/bin/env python
# bottle.py boilerplate project
from bottle import route, run, template, static_file, request, response
from bs4 import BeautifulSoup
import requests, simplejson as json, webbrowser, os, lxml, re
# the decorator
def enable_cors(fn):
def _enable_cors(*args, **kwargs):
mkdir heroku
cd heroku/
virtualenv --no-site-packages env
source env/bin/activate
pip install bottle gevent
pip freeze > requirements.txt
cat >app.py <<EOF
import bottle
import os
@j0lvera
j0lvera / social-colors.css
Last active September 28, 2022 23:05
social-colors.css
.fa-facebook-square { color: #3b5998; }
.fa-twitter-square { color: #55acee; }
.fa-google-plus-square { color: #dd4b39; }
.fa-linkedin-square { color: #0976b4; }
.fa-pinterest-square { color: #cc2127; }
.fa-youtube-square { color: #b31217; }
.fa-instagram { color: #3f729b; }
@j0lvera
j0lvera / $.3.js
Created May 10, 2014 16:26 — forked from ofca/$.3.js
// based on https://gist.github.com/Potfur/5576225 & https://github.com/james2doyle/saltjs
// more info: https://plus.google.com/109231487156400680487/posts/63eZzzrBSb6
window.$ = function(s) {
var c = {
'#': 'ById',
'.': 'sByClassName',
'@': 'sByName',
'=': 'sByTagName'}[s[0]];
return document[c?'getElement'+c:'querySelectorAll'](s.slice(1))
};
@j0lvera
j0lvera / .vimrc
Created May 5, 2014 21:49
.vimrc on mac
set nocompatible
" set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
nmap <leader>l :set list!<CR>
" set listchars=tab:▸\ ,eol:¬
" pathogen
call pathogen#infect()
call pathogen#helptags()
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Put itunesartist and itunestrack into PATH
@j0lvera
j0lvera / 0_reuse_code.js
Created April 27, 2014 23:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console