Skip to content

Instantly share code, notes, and snippets.

View miloplacencia's full-sized avatar

Camilo Placencia Ulloa miloplacencia

View GitHub Profile
/*
* 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() {
@mignev
mignev / gist:1683387
Created January 26, 2012 15:46
Simple example of webview in appcelerator
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
@eirikbacker
eirikbacker / addEventListener-polyfill.js
Created June 3, 2012 19:30
addEventListener polyfill for IE6+
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
@MikeRogers0
MikeRogers0 / twitter-proxy.php
Last active June 3, 2019 12:56
This is a neat little script you can use to quickly make OAuth requests to the twitter rest API v1.1.
<?php
/**
* Usage:
* Send the url you want to access url encoded in the url paramater, for example (This is with JS):
* /twitter-proxy.php?url='+encodeURIComponent('statuses/user_timeline.json?screen_name=MikeRogers0&count=2')
*/
// The tokens, keys and secrets from the app you created at https://dev.twitter.com/apps
$config = array(
@atma
atma / nginx.conf
Created August 18, 2013 16:45
Nginx + nodejs + socket.io websockets
# Add to nginx.conf http section
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@nnarhinen
nnarhinen / Gruntfile.js
Last active February 11, 2020 09:39
Support html5 pushState (or angular.js html5mode) in a yeoman (grunt-contrib-connect) application.
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
//MODIFIED: add require for connect-modewrite
var modRewrite = require('connect-modrewrite');
grunt.initConfig({
@thomasfr
thomasfr / nginx.conf
Last active December 1, 2019 20:04
nginx vhost / site config file
upstream node_backend {
server 127.0.0.1:3000;
keepalive 32;
}
server {
root /var/www/testapp/public;
index index.html;
@achiko
achiko / gist:9570304
Created March 15, 2014 16:51
How To Install CouchDB from Source on a CentOS 6 x64 VPS
1 Heloo :)
2 yum update
3 reboot
4 yum localinstall http://epel.mirror.srv.co.ge/6/i386/epel-release-6-8.noarch.rpm
5 uname -rs
6 yum localinstall http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
7 yum update
8 yum install gcc
9 yum install make
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active April 2, 2024 14:57
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook