Skip to content

Instantly share code, notes, and snippets.

@reinislejnieks
reinislejnieks / gist:2134545
Created March 20, 2012 12:15
jQuery : various
/* include jQuery */
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script src="http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
/*--------------------------------*/
jQuery(document).ready(function($){
$('').addClass("");
});
/*--------------------------------*/
$(document).ready(function(){
@reinislejnieks
reinislejnieks / gist:2134603
Created March 20, 2012 12:23
css : media query reporter
/* ======================================
CSS3 Media Query Reporter
v. 1.0.1
by David Cochran - aLittleCode.com
========================================= */
body:after {
content: "less than 320px";
@reinislejnieks
reinislejnieks / gist:2158961
Created March 22, 2012 15:17
Google Fonts use example - Helvetica like
<link href="http://fonts.googleapis.com/css?family=Anonymous+Pro:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css" >
<style>
.helv {font:14px 'Anonymous Pro', serif;}
</style>
<p class="helv">I'm almost cool like helvetica.</p>
<p>I'am normal Arial shit.</p>
<a href="http://www.webdesignshock.com/helvetica-free-download" target=_blank>http://www.webdesignshock.com/helvetica-free-download</a> - tady doporučují, které fonty použít, které vypadají nejvíce Helvetica-like. Myslm, že tenhle je v cajku, ale klidně čekni další.
@reinislejnieks
reinislejnieks / README.markdown
Created April 3, 2012 12:19 — forked from marijn/README.markdown
List of nationalities in YAML, CSV and TXT format

List of nationalities

It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.

##List of countries

I've also compiled a list of countries

<?php
$arr = array('key' => 'value', 'key' => $value);
$arr2 = array(array('key' => 'value', 'key'),array('key' => 'value', 'key' => ''),array('key' => 'value', 'key'));
$arr3 = array('key' => array('one' => 'two', 'three' => 'four'), array('foo' => 'bar', 'condition' => false));
$arr4 = array();
$arr4[] = 'key' => 'value', 'foo' => 'bar';
@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 / gist:2891269
Created June 7, 2012 20:08
useful WP things
<?php
wp_enqueue_script('jquery'); /*in header.php before wp_head();*/
/*--------------------------------*/
/* for wp */
wp_deregister_script('jquery');
wp_register_script('jquery',("http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"),false,'1.6.2');
wp_enqueue_script('jquery');
/*--------------------------------*/
bloginfo('template_directory');
/*--------------------------------*/
@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
) );