Skip to content

Instantly share code, notes, and snippets.

View angelxmoreno's full-sized avatar

Angel S. Moreno angelxmoreno

View GitHub Profile
@fabiotatsuo
fabiotatsuo / Install ElasticSearch 1.6.0 Ubuntu 15.04
Last active December 16, 2016 16:21
Install ElasticSearch 1.6.0 Ubuntu 15.04
Install Java
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo aptitude -y install oracle-java8-installer
java -version
Install ElasticSearch
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.deb
@iaserrat
iaserrat / FBLogin.swift
Last active April 7, 2016 06:16
This is a swift port of the official FacebookSDK login tutorial. It's been tested on Xcode 6 Beta 1 with the iOS 8 Simulator. You can find the official FB tutorial here: https://developers.facebook.com/docs/facebook-login/ios/v2.0
// YourProject-Bridging-Header.h
#import <FacebookSDK/FacebookSDK.h>
// AppDelegate.swift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
.
@turbobabr
turbobabr / _.isDefined.js
Last active November 22, 2016 03:23
Underscore.js isDefined mixin
// Underscore.js isDefined mixin
// Returns true if value is defined.
_.mixin({
isDefined: function(reference) {
return !_.isUndefined(reference);
}
});
/* Example:
var obj = {
@facultymatt
facultymatt / Procfile
Created April 12, 2013 16:23
Get Deployd running on Heroku!
web: node server
@simkimsia
simkimsia / installation-12-10-ubuntu.sh
Last active February 12, 2020 10:46
preparing a fresh 12.10 ubuntu server for cakephp 2.4
#!/bin/bash
###
#
# forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea
# Copyright (c) 2011 Cake Development Corporation (http//cakedc.com)
#
# Ubuntu 12.10 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 12.10 server:
#
@angelxmoreno
angelxmoreno / ExceptionRendererFixed.php
Created November 23, 2012 20:07
Workaround for CakePHP bug #3389 ExceptionRenderer uses the wrong viewClass
<?php
/**
* Exception Renderer Fixed
* Angel S. Moreno (angelxmoreno@gmail.com)
*
* As per ticket #3389 (http://cakephp.lighthouseapp.com/projects/42648/tickets/3389-exceptionrenderer-uses-the-wrong-viewclass)
* the ExceptionRenderer fails to use the proper view class when an exception is thrown in the AppController's beforeFilter.
* This new ExceptionRenderer extends the original and updates the view class based on RequestHandlerComponent::params['ext'] and
* Router::extensions(). It assumes that when RequestHandlerComponent::params['ext'] is set and the extention is in the array of
* Router::extensions(), that the viewClass to use is prefixed by the extension being used. That being said, when the extenion is
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@DustyReagan
DustyReagan / Twitter User Object MySQL Schema.sql
Created April 1, 2010 23:22
Twitter User Object MySQL Schema
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`created_at` timestamp NOT NULL default '0000-00-00 00:00:00',
`name` varchar(80) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(120) default NULL,
`description` varchar(640) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(100) default NULL,