This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// YourProject-Bridging-Header.h | |
#import <FacebookSDK/FacebookSDK.h> | |
// AppDelegate.swift | |
import UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Underscore.js isDefined mixin | |
// Returns true if value is defined. | |
_.mixin({ | |
isDefined: function(reference) { | |
return !_.isUndefined(reference); | |
} | |
}); | |
/* Example: | |
var obj = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: node server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Exception Renderer Fixed | |
* Angel S. Moreno ([email protected]) | |
* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |