Skip to content

Instantly share code, notes, and snippets.

@JDsnips
JDsnips / jQuerify
Created January 30, 2013 21:47
jquerify bookmarklet - from http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet/ with google CDN without protocol
javascript: (function() {
var el = document.createElement("div"),
b = document.getElementsByTagName("body")[0],
otherlib = !1,
msg = "";
el.style.position = "fixed", el.style.height = "32px", el.style.width = "220px", el.style.marginLeft = "-110px", el.style.top = "0", el.style.left = "50%25", el.style.padding = "5px 10px", el.style.zIndex = 1001, el.style.fontSize = "12px", el.style.color = "#222", el.style.backgroundColor = "#f99";
function showMsg() {
var txt = document.createTextNode(msg);
el.appendChild(txt), b.appendChild(el), window.setTimeout(function() {
@JDsnips
JDsnips / _contentCoregraphy.scss
Created January 23, 2013 20:55
SASS - Content coregraphy mixin
@mixin boxit ($dir) {
display:box;
display:-moz-box;
display:-webkit-box;
box-orient:$dir;
-moz-box-orient:$dir;
-webkit-box-orient:$dir;
}
@mixin order ($num) {
@JDsnips
JDsnips / export-joomla-db
Created January 19, 2013 04:55
Joomla database export php shell script - pulls in JConfig from configuration.php - insert per line for version control - removes records irrelevant to version control
#!/usr/bin/env php
<?php
require('configuration.php');
$config = new JConfig();
$dumpFilename = '.DB/dump.sql';
$con = mysql_connect($config->host, $config->user, $config->password);
if(!mysql_select_db($config->db)) {
echo "Could not select DB\n" . mysql_error();
@JDsnips
JDsnips / import-joomla-db
Created January 19, 2013 04:51
joomla database import php shell script - pulls in JConfig from configuration.php
#!/usr/bin/env php
<?php
require('configuration.php');
$config = new JConfig();
$dumpFilename = '.DB/dump.sql';
$con = mysql_connect($config->host, $config->user, $config->password);
if(!mysql_select_db($config->db)) {
echo "Could not select DB\n" . mysql_error();

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
<!-- Top Bar -->
<nav class="top-bar">
<ul>
<!-- Title Area -->
<li class="name">
<h1>
<a href="#">
Top Bar Title
</a>
<!-- Header and Nav -->
<div class="row">
<div class="three columns">
<h1><img src="http://placehold.it/400x100&text=Logo" /></h1>
</div>
<div class="nine columns">
<ul class="nav-bar right">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<!-- Nav Bar -->
<div class="row">
<div class="twelve columns">
<ul class="nav-bar">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
</ul>
<!-- Header and Nav -->
<div class="row">
<div class="twelve columns">
<div class="panel">
<h1>Feed Template</h1>
</div>
</div>
</div>
<!-- Header and Nav -->
<div class="row">
<div class="three columns">
<h1><img src="http://placehold.it/400x100&text=Logo" /></h1>
</div>
<div class="nine columns">
<ul class="nav-bar right">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>