Skip to content

Instantly share code, notes, and snippets.

git init
git submodule add git://github.com/kohana/core.git system
git submodule add git://github.com/kohana/database.git modules/database
git submodule add git://github.com/kohana/userguide.git modules/userguide
git submodule add git://github.com/kohana/image.git modules/image
git submodule add git://github.com/kohana/codebench.git modules/codebench
git submodule add git://github.com/kohana/auth.git modules/auth
git submodule add git://github.com/kohana/pagination.git modules/pagination
git submodule add git://github.com/kohana/orm.git modules/orm
@rutger1140
rutger1140 / gist:4233523
Created December 7, 2012 14:18
Webfaction - check memory usage
ps -u $USER -o rss,command | grep -v peruser | grep -v 'ps -u' | awk '{sum+=$1} END {print sum/1024}'
@robdodson
robdodson / gist:bab25f5286d0ebc13c48
Last active June 9, 2017 14:12
polymer gravatar
<polymer-element name="user-gravatar" attributes="email">
<template>
<img src="https://secure.gravatar.com/avatar/{{gid}}" />
</template>
<script>
Polymer('user-gravatar', {
ready: function() {
this.gid = md5(this.email);
}
});
@JeffreyWay
JeffreyWay / snippet.xml
Created September 13, 2012 20:23
Laravel Resource - Sublime Text 2 Snippet
<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');
@andyedinborough
andyedinborough / jquery.oauth.js
Created June 7, 2011 19:30
Introduces $.oauth() to make using OAuth from jQuery as easy as using $.ajax()
(function (window, document, $, undefined) {
if (!$.Deferred) throw 'jQuery 1.5 is required to use the jQuery.oauth script!';
function require(name, url) {
if (window[name] === undefined)
return $.ajax({ type: 'GET', cache: true, dataType: 'script', url: url });
}
$.oauth = function (options) {
var d = $.Deferred();
if (typeof (AC) === "undefined") {
AC = {}
}
AC.ImageReplacer = Class.create({
_defaultOptions: {
listenToSwapView: true,
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i,
filenameInsert: "_☃x",
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i,
attribute: "data-hires",
@zachleat
zachleat / gist:2008932
Created March 9, 2012 21:56
Prevent zoom on focus
// * iOS zooms on form element focus. This script prevents that behavior.
// * <meta name="viewport" content="width=device-width,initial-scale=1">
// If you dynamically add a maximum-scale where no default exists,
// the value persists on the page even after removed from viewport.content.
// So if no maximum-scale is set, adds maximum-scale=10 on blur.
// If maximum-scale is set, reuses that original value.
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0">
// second maximum-scale declaration will take precedence.
// * Will respect original maximum-scale, if set.
// * Works with int or float scale values.
@JeffreyWay
JeffreyWay / .bash_profile
Created May 8, 2013 18:02
Laravel aliases
# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package
// Brightness math based on:
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function brightness($color) {
// Extract color components
@sjozsef
sjozsef / Pure Bootstrap Contact Form 7 template
Last active March 23, 2023 10:03
bootstrap-contact-form-7.html
<hr />
<div class="row">
<div class="col-md-4">
[text* your-name class:form-control placeholder "Name (required)"]
</div>
<div class="col-md-4">
[email* your-email class:form-control placeholder "Email (required)"]