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 | |
/*** | |
* filepath: application/core/MY_Controller.php | |
*/ | |
//setup your base controller | |
class DB_Controller extends CI_Controller { | |
//declare them globally in your controller | |
protected $billing_db; |
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
var component = (function($){ | |
var default_options = { | |
array_option : [], | |
string_option : "default" | |
}; | |
return { | |
other_function: function(args) { |
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
$('button').click(function() { | |
$('form').each(function() { | |
var action = $(this).attr("action"); | |
var data = $form.serialize(); | |
$.post(action, data); | |
}); | |
}); |
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 gitphpcheck () { | |
filearray=() | |
while read line; do | |
if [[ $line =~ ^(M|N) ]] | |
then | |
filename="`echo $line | awk '{ print $2 }'`" | |
filearray+=($filename) |
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
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
[user] | |
name = ***YOUR NAME*** | |
email = ***YOUR EMAIL*** | |
[core] | |
excludesfile = /path/to/global/.gitignore | |
editor = ***PREFERRED EDITOR*** |
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
# this snippet rewrites your prompt to include the current branch if in a git repo | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1="\[\e[01;33m\]\w \$(parse_git_branch): \[\e[00m\]" |
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 if (! defined('BASEPATH')) exit('No direct script access'); | |
class Base_m extends CI_Model { | |
protected $table_name; | |
protected $pk_field; | |
public function __construct() | |
{ | |
parent::__construct(); |
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
<? | |
$data = array(); | |
foreach($_POST as $key => value) | |
{ | |
if ( $this->input->post($key) ) // if a value is set | |
{ | |
$data[$key] = $this->input->post($key, true); //protect against xss | |
} | |
} |
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 _remap($method) | |
{ | |
$param_offset = 2; | |
// Default to index | |
if ( ! method_exists($this, $method)) | |
{ | |
// We need one more param |
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
// grab input field to filter with | |
EditText etFilter = FindViewById(Resource.Id.studentFilter); | |
// call custom adapter filter method on TextChange | |
etFilter.TextChanged += delegate(object sender, Android.Text.TextChangedEventArgs e) | |
{ | |
adapter.filterStudents(e.Text.ToString()); | |
}; |
OlderNewer