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
{form myForm} | |
<div class="form-group"> | |
{label book class => 'control-label'/} | |
{input book class => form-control} | |
</div> | |
<div class="form-group"> | |
{input send class => 'btn btn-primary'} | |
</div> | |
{/form} |
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 | |
/* | |
* Iteration and Recursive Iteration Examples Code | |
* | |
* @link http://stackoverflow.com/questions/12077177/how-does-recursiveiteratoriterator-works-in-php | |
* @author hakre <http://hakre.wordpress.com> | |
*/ | |
### To have these examples to work, a directory with subdirectories is needed, | |
### I named mine "tree": |
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
/* ******************************************************************************************* | |
* THE UPDATED VERSION IS AVAILABLE AT | |
* https://github.com/LeCoupa/awesome-cheatsheets | |
* ******************************************************************************************* */ | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
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
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
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
// XPath CheatSheet | |
// To test XPath in your Chrome Debugger: $x('/html/body') | |
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
// 0. XPath Examples. | |
// More: http://xpath.alephzarro.com/content/cheatsheet.html | |
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
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
/// Base path for assets (fonts, images...), | |
/// should not include trailing slash | |
/// @access public | |
/// @type String | |
$asset-base-path: '../assets' !default; | |
/// Asset URL builder | |
/// @access private | |
/// @param {String} $type - Asset type, matching folder name | |
/// @param {String} $file - Asset file name, including extension |
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 | |
$arr = array( | |
array('a', '1'), | |
array('b', '2'), | |
); | |
// klasicky | |
$out = array(); |
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
UPDATE tablename | |
SET columnname = ELT(0.5 + RAND() * 6, 'value 1','value 2','value 3','value 4','value 5','value 6') |
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
Initially, I found bitmasking to be a confusing concept and found no use for it. So I've whipped up this code snippet in case anyone else is confused: | |
<?php | |
// The various details a vehicle can have | |
$hasFourWheels = 1; | |
$hasTwoWheels = 2; | |
$hasDoors = 4; | |
$hasRedColour = 8; |
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
// orig source: https://guwii.com/bytes/sass-function-loop-headings-h1h2h3h4h5h6/ | |
@function headings($from:1, $to:6) { | |
@if $from == $to { | |
@return 'h#{$from}'; | |
} @else { | |
@return 'h#{$from},' + headings($from+1, $to); | |
} | |
} |