$("button").single_double_click(function () {
alert("Try double-clicking me!")
}, function () {
alert("Double click detected, I'm hiding")
$(this).hide()
})
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 | |
class config { | |
// For PHPMailer Class for sending email from forms and error reports | |
const defaultEmail = ''; | |
const defaultFrom = ''; | |
const notifyEmail = ''; | |
const notifyName = ''; | |
// For database connection scheme |
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/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is chosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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 | |
/* | |
name: formatted interpolate (see: http://bit.ly/198oCOP on interpolation) | |
author: bign8 | |
description: using the format "{key|format}", interpolatef does formatted interpolation of strings using sprintf formatting | |
*/ | |
function interpolatef( $message, array $context = array()) { | |
$callback = function ($matches) use ($context) { // function that formats data as specified | |
$format = $matches[2] == '' ? '%s' : $matches[2] ; // default format | |
return (isset($context[$matches[1]])) ? sprintf($format, $context[$matches[1]]) : $matches[0]; |
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
angular.module('app', []). | |
controller('ctrl', ['$scope', function ($scope) { | |
$scope.pages = function () { | |
return Math.ceil( $scope.filtered_users.length / $scope.limit ) || 1; | |
}; | |
}]). | |
filter('pagination', function () { | |
return function (inputArray, selectedPage, pageSize) { |
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
// Note: pre-fetching all images is dumb! It wastes bandwidth on content that "might" be viewed | |
// Instead: Look up something called "Lazy Loading" | |
(function (queue, mapper) { | |
mapper = mapper || function (obj) { return obj; }; | |
var image = new Image(), index = 0; | |
image.onload = function () { | |
if (index < queue.length) image.src = mapper( queue[index++] ); | |
}; | |
image.onerror = function (e) { |
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
N8.surl.store_links([ | |
"http://bign8.info/", | |
"http://dbv.vizuina.com/", | |
"https://github.com/facebook/facebook-php-sdk", | |
"https://developers.facebook.com/docs/graph-api/real-time-updates/#yourcallbackserver", | |
"http://www.pi-supply.com/pi-supply-switch-v1-1-code-examples/", | |
"http://www.mausberrycircuits.com/pages/setup", | |
"http://playground.arduino.cc/Code/AvoidDelay", | |
"http://arduino.cc/en/Tutorial/BlinkWithoutDelay", | |
"http://jflasher.github.io/spark-helper/", |
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
// A sample MCE_OBJ that can load on everything, then clean itself up for the directive above. | |
var MCE_OBJ = { | |
selector: 'textarea', | |
menubar: false, | |
toolbar_items_size: 'small', | |
plugins: 'link image code', | |
toolbar: "undo redo | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image code", | |
setup: function (editor) { // cleanup for angular | |
delete MCE_OBJ.selector; |
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
var app = require('express')(), | |
gravatar_proxy = require('./gravatar-proxy.js'); | |
app.all('/gravatar/:hash', gravatar_proxy()); // http://localhost/gravatar/example@example.com | |
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 session_start(); $_SESSION['hash'] = uniqid(); ?> | |
<!-- ... --> | |
<form method="post" action="/mail.php"> | |
<input type="hidden" name="hash" value="<?php echo $_SESSION['hash']; ?>" /> | |
<!-- ... --> |
OlderNewer