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 dump($data, $depth=0){ | |
foreach($data as $key => $item){ | |
for($i=0; $i < $depth; $i++){ | |
echo "\t"; | |
} | |
if(is_string($item)) $item = "String"; | |
echo $key." -> ".$item."\n"; | |
if(is_array($item)) dump($item, $depth+1); | |
} | |
} |
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
<link rel="apple-touch-icon" href="path/to/touchicon.png"> | |
<link rel="icon" href="path/to/favicon.png"> | |
<!--[if IE]><link rel="shortcut icon" href="path/to/favicon.ico"><![endif]--> | |
<!-- or, set /favicon.ico for IE10 win --> | |
<meta name="msapplication-TileColor" content="#D83434"> | |
<meta name="msapplication-TileImage" content="path/to/tileicon.png"> |
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(){ | |
doStuff(); | |
setTimeout(arguments.callee, 100); | |
})(); |
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() { | |
if ("-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/)) { | |
var msViewportStyle = document.createElement("style"); | |
msViewportStyle.appendChild( | |
document.createTextNode("@-ms-viewport{width:auto!important}") | |
); | |
document.getElementsByTagName("head")[0].appendChild(msViewportStyle); | |
} | |
})(); |
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> | |
<input type="radio" name="radio" id="radio1" class="radio" checked/> | |
<label for="radio1">First Option</label> | |
</div> | |
<div> | |
<input type="radio" name="radio" id="radio2" class="radio"/> | |
<label for="radio2">Second Option</label> | |
</div> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
read -e IMAGE; | |
defaults write com.apple.desktop Background "{default = {ImageFilePath='$IMAGE'; };}" | |
killall Dock |
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 ($user->isSuperuser()) { | |
//first remove the fields from 'user' template before deleting them. | |
$t = $templates->get('user'); | |
$fg = $t->fieldgroup; | |
$fg->remove($fields->get('your_field')); | |
$fg->save(); | |
//delete the fields |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
a, img{ | |
display: block; | |
} |
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 | |
$array = ["lot's", "of", "elements", "…"]; | |
$allConcatinations = []; | |
for ($a=0; $a<count($array); $a++) { | |
for ($b=$a+1; $b<count($array); $b++) { | |
array_push($allConcatinations, $array[$a]." ".$array[$b]); | |
} | |
} |
OlderNewer