This is a list of the SublimeText 2 addons I use for my development environment.
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
<?xml version="1.0"?> | |
<layout> | |
<default> | |
<!--Root/Default Layouts--> | |
<reference name="root"> | |
<!--Appending Block--> | |
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> | |
</reference> | |
<!--CSS and JS Files--> |
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 | |
// cleanup.php?clean=var | |
// cleanup.php?clean=log | |
$xml = simplexml_load_file('./app/etc/local.xml', NULL, LIBXML_NOCDATA); | |
$db['host'] = $xml->global->resources->default_setup->connection->host; | |
$db['name'] = $xml->global->resources->default_setup->connection->dbname; | |
$db['user'] = $xml->global->resources->default_setup->connection->username; |
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
-- Two dashes start a one-line comment. | |
--[[ | |
Adding two ['s and ]'s makes it a | |
multi-line comment. | |
--]] | |
---------------------------------------------------- | |
-- 1. Variables and flow control. | |
---------------------------------------------------- |
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 | |
/** | |
* Example of simple product POST using Admin account via Magento REST API. OAuth authorization is used | |
*/ | |
$callbackUrl = "http://yourdomain.com/magento-create-product-rest-api.php"; // the URL of this file | |
$temporaryCredentialsRequestUrl = "http://yourdomain.com/oauth/initiate?oauth_callback=" . urlencode($callbackUrl); | |
$adminAuthorizationUrl = 'http://yourdomain.com/admin/oauth_authorize'; | |
$accessTokenRequestUrl = 'http://yourdomain.com/oauth/token'; | |
$apiUrl = 'http://yourdomain.com/api/rest'; | |
$consumerKey = 'v3b7p1yn29q0378ybk9w5d7hrsmiifpf'; |
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 | |
cmd="sudo varnishadm -T 127.0.0.1:6082 -S /etc/varnish/secret" | |
site=$(echo $1 | sed -r 's|https?://||;s|/(.*)||;') | |
page=$(echo $1 | awk -F'/' -v OFS='/' '{sub(/https?:\/\//, ""); $1=""; print $0}') | |
if [ -z "$1" ]; then | |
echo "ERROR: please provide a URL to purge.." | |
echo "USAGE: " |
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
# From http://css-tricks.com/snippets/htaccess/force-files-to-download-not-open-in-browser/ | |
AddType application/octet-stream .csv | |
AddType application/octet-stream .xls | |
AddType application/octet-stream .doc | |
AddType application/octet-stream .avi | |
AddType application/octet-stream .mpg | |
AddType application/octet-stream .mov | |
AddType application/octet-stream .pdf |
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
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
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 getGreetingTime (m) { | |
var g = null; //return g | |
if(!m || !m.isValid()) { return; } //if we can't find a valid or filled moment, we return. | |
var split_afternoon = 12 //24hr time to split the afternoon | |
var split_evening = 17 //24hr time to split the evening | |
var currentHour = parseFloat(m.format("HH")); | |
if(currentHour >= split_afternoon && currentHour <= split_evening) { |