This file contains hidden or 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> | |
<style type="text/css"> | |
input[ type=submit ] { | |
color: transparent; | |
background: transparent url("http://placekitten.com/128/128") no-repeat fixed; | |
border: none; | |
width: 64px; | |
height: 64px; |
This file contains hidden or 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
document.addEventListener("DOMContentLoaded", function() { | |
var elms = document.getElementsByClassName( 'foo' ); | |
for( var i = 0; i < elms.length; i++ ) | |
elms[i].addEventListener( "click",function() { | |
this.focus(); | |
this.select(); | |
}); | |
}); |
This file contains hidden or 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 | |
/** | |
* Autoloader | |
*/ | |
// Define some useful constants | |
if(!defined('DS')) | |
define('DS', DIRECTORY_SEPARATOR); | |
if(!defined('PS')) |
This file contains hidden or 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 | |
include_once 'PrulRoute.php'; | |
include_once 'PrulException.php'; | |
class Prul | |
{ | |
protected static $routes = array(); | |
const GET = 'GET'; | |
const POST = 'POST'; |
This file contains hidden or 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
// ==UserScript== | |
// @name Australia | |
// @include * | |
// @version 1.0 | |
// ==/UserScript== | |
(function(d){ | |
var rules = ['transform', '-moz-transform', '-webkit-transform', '-ms-transform', '-o-transform'], | |
deg = 180, css = ''; | |
for(var i = 0; i < rules.length; i++) { |
This file contains hidden or 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
CREATE DATABASE `php_mysqltest`; | |
CREATE TABLE `test` ( | |
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`test_int` int(11) DEFAULT NULL, | |
`test_float` float DEFAULT NULL, | |
`test_string` varchar(40) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
This file contains hidden or 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 | |
function car_dump() { | |
return call_user_func_array('var_dump', func_get_args()); | |
} | |
$foo = array( | |
'bar', | |
'baz', | |
'quux' | |
); |
This file contains hidden or 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
/* | |
* In this example, `panelElement` references to some DOM object, | |
* with the open, close and toggle methods to show/hide it. | |
*/ | |
// This function opens or closes our panel, according to the swipe coordinates | |
panelElement.performSwipe = function(swipeStart, swipeEnd) { | |
// In case of a short swipe, just toggle the panel. | |
if (Math.abs(start - end) < 16) { | |
this.toggle(); |
This file contains hidden or 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
# Ask for the administrator password upfront | |
sudo -v | |
# Upgrade the system, install X and Alsa stuff | |
pacman -S \ | |
xorg xorg-server xorg-xinit xorg-server-utils xf86-video-fbdev \ | |
alsa-firmware alsa-lib alsa-plugins alsa-utils \ | |
vim git tmux mpd mpc ncmpc htop | |
# Enable the sound device |
This file contains hidden or 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 | |
class Event extends ActiveRecord\Model | |
{ | |
static private $before_save = 'calculate_seats_available'; | |
private function calculate_seats_available() { | |
$this->seats_available = $this->seats - $this->seats_taken; | |
} | |
} |