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 | |
/* | |
Checks if something is set and not empty | |
Pass the variable as a reference to truly check its | |
legitness. | |
*/ | |
function _islegit(&$variable = null) | |
{ | |
if($variable) { |
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 | |
// App/controllers/components/rest_request.php | |
// shamelessly lifted from: http://www.gen-x-design.com/archives/making-restful-requests-in-php/ | |
// slightly modified | |
class RestRequestComponent extends Object | |
{ | |
var $components = array('Session'); | |
protected $url; | |
protected $verb; |
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
import Realm | |
class ModelName: RLMObject { | |
dynamic name: String = "" | |
dynamic value: Int = 0 | |
} |
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 | |
$view = new View($this, false); | |
$view->set(compact('some', 'vars')); | |
$html = $view->render('view_name'); |
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 /* The Uploader class is a simple php script that makes file | |
* uploads a bit easier. | |
* @author Junaid Qadir Baloch (shekhanzai.baloch@gmail.com) | |
* @version 0.1 10:18 PM 7/30/2011 | |
*/ | |
class Uploader | |
{ | |
private $allowedFileTypes; | |
private $maxFileSize = 1048576; | |
private $fileInputBoxName; |
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 basicly finds an 'a' element inside another element, then redirects to it's HREF | |
// useful for faking link behaviour on block level elements, without having to make them a tags. | |
// be careful to have a fallback for when javascript is disabled. | |
$(document).ready(function(){ | |
// onclick obviously | |
$('element').click(function(){ | |
// $(this) refers to jquery object passed inot he method. it would be of 'element' in this case. |
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 // PHP | |
// Shuffle some html, then echo them to the screen. | |
// why? because It's flipping easy! | |
$slides = array( | |
'<img src="/img/pic1.jpg" />', | |
'<img src="/img/pic2.jpg" />', | |
'<img src="/img/pic3.jpg" />', |
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
// Jquery Function BoilerPlate for newbies | |
// | |
// | |
// Surrounded by parentheses to allow anonymous founcitons on the inside | |
(function($){ // pass the jquery pseudo variable "$" into the function in order to create it's awesomeness. | |
$.fn.yourFucntion = function(userConfig) { | |
// please note, the "this" variable in the current scope will refer to the |
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
<div class="panel-container"> | |
<a class="panelSwitch"> | |
<h5>button</h5> | |
</a><!-- End of .panelSwitch --> | |
<div style="" class="panelBoard"> | |
<!-- Fill me with any content --> | |
</div><!-- End of .panelBoard --> |
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
// kowFocus.js | |
// A little javascript to echo which element has the focus hardcore. (Uses Jquery) | |
// written by: Karl Oscar Weber, http://karloscarweber.com | |
setTimeout(function(){ | |
$('*').on('focus', function(){ | |
console.log($(this)); | |
}) | |
}, 2000); |
OlderNewer