Skip to content

Instantly share code, notes, and snippets.

@darookee
darookee / .sh
Created December 4, 2012 21:38
List of javascript event attributes
# http://h43z.blogspot.de/
wget -qO- /dev/null http://t.co/QzpT3EyC | grep -Po '.*?\K(?<=>)on.*?(?=<)'
@darookee
darookee / gist:4349669
Created December 20, 2012 23:52
Apache Timestamp Format with `date`
# date +\[%d\/%b\/%G:%R:%S\ %z\]
[21/Dec/2012:00:50:56 +0100]
(function(d, script) {
var js,
fjs = d.getElementsByTagName(script)[0];
function load(url, id) {
if(d.getElementById(id)) {return;}
js = d.createElement(script);
js.async = true;
js.src = url;
<?php return array (
'db' =>
array (
'username' => 'root',
'password' => 'root',
'host' => 'localhost',
'port' => '3306',
'dbname' => 'shopware',
),
'mail' => array(
<?php
backup_tables('localhost','user','p4ssw0rd','database');
/* backup the db OR just a table */
function backup_tables($host,$user,$pass,$name,$tables = '*')
{
$link = mysql_connect($host,$user,$pass);
mysql_select_db($name,$link);
<?php
namespace Rookee\Console\Command;
use Symfony\Component\Console\Command\Command,
Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Input\InputOption,
Symfony\Component\Console\Input\InputInterface,
Symfony\Component\Console\Output\OutputInterface;
-- SPLIT_STR MySQL Function
-- from http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/
CREATE FUNCTION SPLIT_STR(
x VARCHAR(255),
delim VARCHAR(12),
pos INT
)
RETURNS VARCHAR(255)
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos),
@darookee
darookee / git.rb
Created February 10, 2014 10:28 — forked from alx/git.rb
require 'git'
module Jekyll
class GitActivityTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
end
def render(context)
@darookee
darookee / color.php
Created June 19, 2014 10:37
Color from string
<?php
function stringToColor($string) {
return substr(hash('crc32', $string), 0, 6);
}
@darookee
darookee / index.html
Created October 28, 2014 19:25
minimal html page
<html>
<head>
<title>This is the Page-Title</title>
</head>
<body>
<img src="/web/path/to/image.jpg" alt="image-title" />
</body>
</html>