Skip to content

Instantly share code, notes, and snippets.

View hullen's full-sized avatar
coffee & learn & code

Hullen Gonzales hullen

coffee & learn & code
View GitHub Profile
@mbijon
mbijon / php.partial.ini
Created March 22, 2014 01:08
XDebug config for verbose debugging info
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.collect_params = 2
xdebug.collect_return = 1
xdebug.collect_vars = 0
xdebug.overload_var_dump = 1
xdebug.show_local_vars = 1
xdebug.profiler_append = 0
@gneutzling
gneutzling / basicRouter.js
Created March 24, 2014 14:25
a simple router used in a basic project.
/**
* Router
* @class Router
* @author gneutzling
* @date 2013-12-20
*
* Class.js by John Resig is needed. (http://ejohn.org/blog/simple-javascript-inheritance/)
*/
APP.core.Router = Class.extend({
@toddmotto
toddmotto / consoleLoge.js
Last active August 29, 2015 13:57
console.loge(), many log, much console
window.console.loge = function (msg) {
var gifs = ['wink','shake-space','peepers','prizza','hat','gradient','fat','rainbow','sunglasses','derp','shake'],
wow = ['', 'wow! ', 'amaze! ', 'dazzle! '],
adjs = ['so', 'such', 'many', 'much', 'very'],
randomizr = function (a) { return a[Math.floor(Math.random() * a.length)];},
message = '%c ' + randomizr(wow) + randomizr(adjs) + ' ' + typeof msg + ': ',
css = 'background: url(http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-' + randomizr(gifs) + '-212.gif) no-repeat 0 0; background-size: 80px 80px; font-family: \'Comic Sans MS\', cursive; text-shadow: 0 1px 1px rgba(0,0,0,1); font-size: 14px; padding: 25px; line-height: 70px; color: #fff; font-weight: 100;';
console.log.apply(console, typeof msg === 'object' ? [message, css, msg] : [message += msg, css]);
};
@marcelaraujo
marcelaraujo / test.html
Last active August 29, 2015 14:01
xmlrequest api bug at Chrome
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
var httpRequest;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
@fernandoporazzi
fernandoporazzi / isprime.js
Last active August 29, 2015 14:03
Detect if a given word is prime according to their letter positions in alphabet.
var alphabet = [
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
];
// get char position in array
function stringToNumber (string) {
var number = 0;
@bob-sims
bob-sims / 00-readme.md
Created September 24, 2012 21:53
Staff Directory demo app for Appcelerator #TiMob training

#Overview

I created this simple Staff Directory App as a demonstration for a small internal staff training workshop. Finished product shown below, goal throughout class was to explain code walkthrough and learning resources in pieces, allowing students to create app as a practical exercise.

..

My goals:

  • Show utility of Titanium Mobile to rapidly create simple, x-platform, enterprisey apps (clever term via @thiswayup)
  • Demonstrate use of app template (Master/Detail) included as part of Ti Studio.
@lipelopeslage
lipelopeslage / parallax-secret.js
Created November 21, 2012 18:30
My parallax secret
/*########################################################################*/
/*###### using jQuery selector for a fast/cross-browser resolution #######*/
/*########################################################################*/
var totalAreas = 6, // this value is obviously arbitrary
winH = $(window).height, // the window height
top = $(window).scrollTop(), // the current scroll value
maxScroll = $(document).height() - winH, // the maximum scroll value
scrollPerc = top/maxScroll, // the current scroll percentage
areaPercent = 0; // init variable
@tonysm
tonysm / Post.php
Created March 6, 2013 17:12
blog tutorial
<?php
/**
*
*/
class Post extends AppModel
{
public $validate = array(
'title' => array(
'rule' => 'notEmpty'
@carldanley
carldanley / wp-modules.js
Last active December 22, 2015 00:28
Example of WP modules object
// new modules object introduction
( function( window, undefined ) {
window.wp = window.wp || {};
window.wp.modules = window.wp.modules || {};
} )( window );
// example Mediator module
wp.modules.Mediator = ( function( window, undefined ) {
@olivierlacan
olivierlacan / DebugKiller.sublime-settings
Last active December 22, 2015 21:19
My Debug Killer (Sublime Text plugin available on Package Control) configuration to catch console.log statements and debugger statements in either JavaScript or CoffeeScript.
{
"patterns": [
{
"pattern": "(console\\.log\\(.*?\\))",
"scopes": [
"storage.type.function.js",
"meta.function.json.js",
"source.js"
]
},