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
/* | |
/** | |
* @constructor | |
*/ | |
Commands = function() { | |
this.undoStack = []; | |
this.redoStack = []; | |
}; | |
/** |
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
// Remove duplicates from DOM (not done yet) | |
function remDuplicates() { | |
var seen = {}; | |
$('td.group').each(function() { | |
var txt = $(this).text(); | |
if (seen[txt]) | |
$(this).empty(); | |
else | |
seen[txt] = true; | |
}); |
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 | |
//Basic True / False Declaration | |
$is_admin = ($user['permissions'] == 'admin' ? true : false); | |
//Conditional Welcome Message | |
echo 'Welcome '.($user['is_logged_in'] ? $user['first_name'] : 'Guest').'!'; | |
//Conditional Items Message | |
echo 'Your cart contains '.$num_items.' item'.($num_items != 1 ? 's' : '').'.'; | |
//Conditional Error Reporting Level | |
error_reporting($WEBSITE_IS_LIVE ? 0 : E_STRICT); | |
//Conditional Basepath |
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
function get_day_name($timestamp) { | |
$date = date('d/m/Y', $timestamp); | |
if($date == date('d/m/Y')) { | |
$day_name = 'Today'; | |
} else if($date == date('d/m/Y',now() - (24 * 60 * 60))) { | |
$day_name = 'Yesterday'; | |
} | |
return $date; | |
} | |
print date('G:i:s', $last_access).' '.get_day_name($last_access); |
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 | |
$path = '/home/someuser/products/data.tar.gz'; // the file made available for download via this PHP file | |
$mm_type="application/octet-stream"; // modify accordingly to the file type of $path, but in most cases no need to do so | |
header("Pragma: public"); | |
header("Expires: 0"); | |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); | |
header("Cache-Control: public"); | |
header("Content-Description: File Transfer"); | |
header("Content-Type: " . $mm_type); |
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
#!/bin/sh | |
SHORTCUT="[Desktop Entry] | |
Name=Sublime Text 2 | |
Comment=Edit text files | |
Exec=/usr/local/sublime-text-2/sublime_text | |
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png | |
Terminal=false | |
Type=Application | |
Encoding=UTF-8 | |
Categories=Utility;TextEditor;" |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php | |
*/ | |
$args = array( |
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
#!/bin/bash | |
# | |
# WP Commandline Local Install, by Brian Richards (@rzen) | |
# | |
# Creates a new directory, downloads WordPress, creates a database, sets up wp-config, | |
# optionally empties wp-content, and deletes other misc files. This compliments my local | |
# dev setup, outlined here: http://rzen.net/development/local-develoment-in-osx/ | |
# | |
# Credit: | |
# Based on WPBuildr (https://github.com/AaronHolbrook/wpbuildr/). Props to Aaron Holbrook |
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
javascript:(function(){ | |
var links=document.querySelectorAll('a.l'), | |
count=links.length; | |
while(count--){ | |
links[count].onmousedown=null; | |
if((/url=/i).test(links[count].href)){ | |
links[count].href=decodeURIComponent(links[count].href.match(/url=([a-z0-9\-+%._]+)&/i)[1].replace(/\+/g, ' ')); | |
} | |
}; | |
})() |
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
/* --CSS Reseter-- */ | |
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, | |
article, aside, dialog, figure, header, footer, hgroup, menu, nav, section, time, mark, audio, video { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
outline: 0; | |
font-weight: inherit; | |
font-style: inherit; |