Skip to content

Instantly share code, notes, and snippets.

View keithics's full-sized avatar

Keith Levi Lumanog keithics

View GitHub Profile
@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: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
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 / 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;
@keithics
keithics / gist:4462455
Last active December 10, 2015 16:38
Class Plugin for Wordpress
<?php
/*
Plugin Name: Plugin for Wordpress
Plugin URI:
Description: A Sample Class Plugin for Wordpress
@keithics
keithics / gist:4482228
Last active December 10, 2015 19:38
Serialize by input - jQuery
/* @projectDescription jQuery Serialize Anything - Serialize anything (and not just forms!)
* @author Bramus! (Bram Van Damme)
* @version 1.0
* @website: http://www.bram.us/
* @license : BSD
* original file : http://www.bram.us/2008/10/27/jqueryserializeanything-serialize-anything-and-not-just-forms/
* modified by Keithics : keith@webninjamobile.com
* usage jQuery('.class_input').serializeAnything()
*/
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array('logo' => 'image');
$input = Input::file('logo');
$validation = Validator::make($input, $rules);
//file not valid
@keithics
keithics / gist:4617986
Created January 24, 2013 05:45
Easy toggle check to All checkboxes
<table>
<tr>
<td>I Lead: <input type="checkbox" id="toggle_select" /></td>
</tr>
<tr>
<td>We Follow :<input type="checkbox" class="toggle_type" /></td>
</tr>
<tr>
<td>We Follow :<input type="checkbox" class="toggle_type" /></td>
</tr>
@keithics
keithics / gist:5557439
Last active December 17, 2015 05:19
Simple Theme Customizer
<?php
function wpcebu_customize_register( $wp_customize ){
// Full Name
$wp_customize->add_section( 'content',
array(
'title' => __( 'Full Name', 'wpcebu2' ), //Visible title of section
)
);
@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
)
);