Skip to content

Instantly share code, notes, and snippets.

View akthechamp's full-sized avatar

Ashish Kumar akthechamp

  • New Delhi, India
View GitHub Profile
@akthechamp
akthechamp / jQuery HTML5 placeholder fix.js
Last active August 29, 2015 14:09 — forked from hagenburger/jQuery HTML5 placeholder fix.js
HTML 5 Placeholder Fix for All Browsers using jQuery
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
source 'https://rubygems.org'
gem 'faye'
gem 'foreman'
gem 'thin'
//
// Part 1: Customize registration form
//
//
// A. Show extra fields on registration form
//
add_action( 'register_form', 'ac_extra_reg_fields', 1 );
function ac_extra_reg_fields() { ?>
wp() {
# Needs two parameters
# Parameter 1 is the account name, or install directory
# Parameter 2 will set the database password
cd ~/../home/${1}/public_html # go to install directory
wget http://wordpress.org/latest.tar.gz # get latest WordPress
tar xfz latest.tar.gz # unpack
chown -R ${1} wordpress # change all files in wordpress to be owned by user (solves a problem when installing as root)
chgrp -R ${1} wordpress # change associated group (solves a problem when installing as root)
mv wordpress/* ./ # move all files from /wordpress to the root directory
function copyright($start, $owner) {
$date = date('Y');
echo "© Copyright ";
if ( $start < $date ) {
echo "{$start} - ";
}
echo "{$date} {$owner}";
}
/*
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
<?php
/**
* Dump helper. Functions to dump variables to the screen, in a nicley formatted manner.
* @author Joost van Veen
* @version 1.0
*/
if (!function_exists('dump')) {
function dump ($var, $label = 'Dump', $echo = TRUE)
{
// Store dump in variable

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Template</title>
<meta name="description" content="The HTML5 Template">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->