Skip to content

Instantly share code, notes, and snippets.

<div id="checkboxes">
<table id="checkboxTable">
<tr>
<td><input type="checkbox" /></td>
<td><input type="checkbox" /></td>
<td><input type="checkbox" /></td>
<td><input type="checkbox" /></td>
</tr>
<tr>
$("#checkboxes").selectable( {filter: "input:checkbox",
stop: function(event, ui) {
$(".ui-selected").each( function(){
$(this).each( function(){
var val = $(this).attr("checked") ? null : "checked";
$(this).attr("checked", val);
});
<?php
require 'php-sdk/src/facebook.php';
$facebook = new Facebook(array(
'appId' => 'YOUR_APP_ID',
'secret' => 'YOUR_APP_SECRET',
));
$req = $facebook->getSignedRequest();
?>
#!/bin/bash
# Usage: ./deleteOld "bucketname" "30 days"
s3cmd ls s3://$1 | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
olderThan=`date -d"-$2" +%s`
if [[ $createDate -lt $olderThan ]]
<?php
namespace Setfive\SextDejourBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" secure="false" />
</cross-domain-policy>
var swfu = new SWFUpload(
{ flash_url: "/assets/swfupload.swf",
flash9_url: "/assets/swfupload_fp9.swf",
file_size_limit: "1000 MB",
file_types: "*.*",
debug: false,
upload_url: "http://your-bucket.s3.amazonaws.com",
button_placeholder_id : "SWFUploadButton",
button_image_url : "/assets/select_filesbtn.png",
button_width: '112',
<?php
/* In PHP */
$encodedPolicy = json_encode( array(
"expiration" => "2011-4-22T13:54:23.000Z",
"conditions" => array(
0 => array( "acl" => "public-read" ),
1 => array( "bucket" => "your-bucket" ),
2 => array( "x-amz-meta-sig" => 'some meta signature to ensure authentic requests'),
3 => array( "redirect" => $'URL to redirect a success request (its doesnt matter)' ),
4 => array( "key" => "the S3 key for the file (the S3 filename)" ),
jQuery.confirm = function(options){
var opts = jQuery.extend( { message: "", ok: function(){}, cancel: function(){ } }, options );
jQuery("<div class='span-10'><div class='ui-confirm-message'>"
+ opts.message + "<img class='loader' style='padding-left: 10px' src='/images/loader.gif' />"
+ "</div></div>").dialog({
autoOpen: true,
modal: true,
autoOpen: false,
<?php
/**
* Implementation of hook_drush_command().
*/
function cm_drush_command() {
// callback is the function that will be called when the command is executed
$items['load-rep-data'] = array(