Skip to content

Instantly share code, notes, and snippets.

@reinislejnieks
reinislejnieks / gist:2891322
Created June 7, 2012 20:21
Sublime Text 2 - Useful Shortcuts

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
@reinislejnieks
reinislejnieks / wordpress.php
Created June 26, 2012 09:40
wordpress - general
<?php
// get all options in array from OPTIONS table
get_alloptions();
// cache database query, so you don't have to query database again
$activity_object = wp_cache_get($id,'activity');
if(false === $activity_object){
$activity_object = $wpdb->get_row(
$wpdb->prepare("SELECT*FROM
$wpdb->activity WHERE ID = %d",$id));
@reinislejnieks
reinislejnieks / profile.php
Created August 19, 2012 14:01 — forked from anonymous/profile.php
Wordpress front end log in page template with multiple custom meta_key - input, select, dropdown
<?php
global $user_ID, $user_identity, $user_level;
if ($user_ID) {
if($_POST)
{
@reinislejnieks
reinislejnieks / foundation-menu.php
Created September 3, 2012 17:23 — forked from awshout/foundation3-navbar-menu.php
WordPress walker for ZURB's Foundation Nav Bar classes
add_theme_support( 'menus' );
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus( array(
'main-menu' => 'Main Menu' // registers the menu in the WordPress admin menu editor
) );
@reinislejnieks
reinislejnieks / neat_r.php
Created October 5, 2012 15:27 — forked from jakelodwick/neat_r.php
neat_r, a tidy alternative to print_r (PHP)
<?PHP
/*
neat_r works like print_r but with much less visual clutter.
By Jake Lodwick. Copy freely.
Example with an array:
$data = array(
"mode" => "sets",
@font-face {
font-family: '[set]Foundicons';
src: url('fonts/[set]_foundicons.eot');
src: url('fonts/[set]_foundicons.eot?#iefix') format('embedded-opentype'),
url('fonts/[set]_foundicons.woff') format('woff'),
url('fonts/[set]_foundicons.ttf') format('truetype'),
url('fonts/[set]_foundicons.svg#[set]Foundicons') format('svg');
font-weight: normal;
font-style: normal;
}
@reinislejnieks
reinislejnieks / jquery.spin.js
Created November 8, 2012 21:32 — forked from innotekservices/jquery.spin.js
jQuery Plugin for Spin.js
/*
Use this with https://github.com/fgnass/spin.js
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@reinislejnieks
reinislejnieks / gist:4477148
Last active June 13, 2017 09:25
#jquery queue and timeout example
/*
Example by Andrew Wirick
originally: http://enterprisejquery.com/2010/07/create-your-first-jquery-plugin-part-1-transition-from-everyday-jquery-code-to-base-plugin/
*/
(function ($, undefined) {
var queueName = 'myFlashMessage';
$.fn.myFlashMessage = function (params) {
@reinislejnieks
reinislejnieks / gist:4479130
Created January 7, 2013 22:29
full css backgroun image
html {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
<!-- example for the http://retinafy.me ebook -->
<style>
div.rss {
background: url(rss.svg);
width: 32px;
height: 32px;
}
body.no-svg div.rss {