Skip to content

Instantly share code, notes, and snippets.

@d9k
d9k / array_replace_recursive_fix.php
Last active August 29, 2015 14:16
array_replace_recursive for php 5.3 and lower
if (!function_exists('array_replace_recursive'))
{
function array_replace_recursive___recurse($array, $array1)
{
foreach ($array1 as $key => $value)
{
// create new key in $array, if it is empty or not an array
if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key])))
{
$array[$key] = array();
@d9k
d9k / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<html>
<head>
<title>Online PHP Script Execution</title>
</head>
<body>
<?php
$text = "Hi, my name is ... See my site example.com?test=azaza&ololo=ttt";
/** @see http://stackoverflow.com/a/1188652/1760643 */
#!/usr/bin/env lein-exec
;; REPL: run as `lein repl` then `(load-file "detect-repl.clj")`
;; CMD: run as `./detect-repl.clj`
;;
;; Where get lein-exec?
;; `wget https://raw.github.com/kumarshantanu/lein-exec/master/lein-exec`
;; see [clojure shellscripting tutorial](https://raw.github.com/kumarshantanu/lein-exec/master/lein-exec)
(println "1 + 2 =" (+ 1 2))
.goldenButton {
-moz-box-shadow:inset 0px 1px 0px 0px #AA8800;
-webkit-box-shadow:inset 0px 1px 0px 0px #AA8800;
box-shadow:inset 0px 1px 0px 0px #AA8800;
border:1px solid #AA8800;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
color:#000000;
text-shadow:0 1px 0 #fceabb;
<html>
<head>
<title>Online PHP Script Execution</title>
</head>
<body>
<?php
$a = array(array('a1' => 5, 'a2' => 6), array('a1' => 2, 'a2' => -1));
echo '<pre>' . var_export($a, true) . '</pre>';
# automatically set user and group in new files on this folder and nested folders.
find `pwd` -type d -exec chmod ug+s '{}' \;
<html>
<head>
<title>Online PHP Script Execution</title>
</head>
<body>
<?php
define(BR, '<br />'."\n");

css:

#single div.yes p:first-child:first-letter, #single div.yes span.drop {
    color: #000;
    float: left;
    font-family: 'Quattrocento',serif;
    font-size: 146px;
    line-height: 102px;

margin-bottom: -6px;