Skip to content

Instantly share code, notes, and snippets.

View keithics's full-sized avatar

Keith Levi Lumanog keithics

View GitHub Profile
@keithics
keithics / RestDialogFragment.java
Created November 26, 2015 13:19
REST Diaglog Class for Android
package com.webninja.usjr.rest;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.FragmentManager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
MEAN Stack - AWS
Installing NodeJS on CenOS/AWS Linux AMI
yum -y update
yum -y groupinstall "Development Tools”
yum -y install screen
cd /usr/src
wget http://nodejs.org/dist/v0.10.4/node-v0.10.4.tar.gz
tar zxf node-v0.10.4.tar.gz
cd node-v0.10.4
@keithics
keithics / gist:1403871945bf076eda21
Created November 22, 2014 15:50
NODE - MONGO - GIT and PM2 installation
installing node on ubuntu 12.0
sudo apt-get update
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo npm install npm -g
Install Mongo
@keithics
keithics / gist:fd53431b6f57014249ca
Last active February 2, 2017 02:49
Mongodump and Amazon Glacier
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
AWS = require('aws-sdk'),
exec = require('child_process').exec,
fs = require('fs'),
name = new Date().toISOString();
@keithics
keithics / gist:9911022
Created April 1, 2014 09:39
Capitalize Word - Angular filter
angular.module('mymodule').filter('ucfirst', function() {
return function(input,arg) {
return input.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
};
});
@keithics
keithics / gist:6190293
Created August 9, 2013 00:52
Get column names in Laravel 4
<?php
class BaseModel extends Eloquent {
public function columns(){
$table = $this->getTable();
return DB::select(" SHOW COLUMNS FROM ".$table);
}
<?php
echo wp_menu_fix('main');
function wp_menu_fix($menu){
$menus = wp_get_nav_menu_items($menu);
@keithics
keithics / gist:6005606
Created July 16, 2013 03:48
Serialize text inputs using Titanium - works with inputs and textarea for now
_.mixin({
serialize:function(el){
var url = [];
_.map(el.getChildren(),function(value,key,el){
if(!_.isUndefined(value.name)){
url.push(value.name+ '=' + value.getValue());
}
});
return '?'+url.join('&');
use Assetic\AssetManager;
use Assetic\Asset\AssetCollection;
use Assetic\Asset\FileAsset;
use Assetic\Asset\GlobAsset;
use Assetic\Filter\Yui;
use Assetic\AssetWriter;
$am = new AssetManager();
@keithics
keithics / gist:5557604
Created May 10, 2013 21:33
Theme options with other samples
<?php
function wpcebu_customize_register( $wp_customize ){
// Full Name
$wp_customize->add_section( 'content',
array(
'title' => __( 'Full Name', 'wpcebu2' ), //Visible title of section
)
);