gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_avatar_from_service(service, userid, size) { | |
// this return the url that redirects to the according user image/avatar/profile picture | |
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback | |
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) | |
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) | |
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) | |
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) | |
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) | |
// everything else will go to the fallback | |
// google and gravatar scale the avatar to any site, others will guided to the next best version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scriptencoding utf-8 | |
let s:calendar_list = [ | |
\ ['Australian Holidays', 'en.australian#[email protected]'], | |
\ ['Austrian Holidays', 'en.austrian#[email protected]'], | |
\ ['Brazilian Holidays', 'en.brazilian#[email protected]'], | |
\ ['Canadian Holidays', 'en.canadian#[email protected]'], | |
\ ['China Holidays', 'en.china#[email protected]'], | |
\ ['Christian Holidays', 'en.christian#[email protected]'], | |
\ ['Danish Holidays', 'en.danish#[email protected]'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function indexed($url) { | |
$url = 'http://webcache.googleusercontent.com/search?q=cache:' . urlencode($url); | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); | |
curl_setopt($ch, CURLOPT_NOBODY, true); | |
curl_setopt($ch, CURLOPT_USERAGENT, 'Chrome 10'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Got bored/bugged of seeing the watermarks/Link at the bottom of 9GAG images. So wrote this script to remove them | |
// Eg. http://d24w6bsrhbeh9d.cloudfront.net/photo/4216213_700b_v1.jpg | |
// Very very basic PHP, but gets stuff done! | |
// Coded while listening to: http://8tracks.com/jkurtis/we-ll-run-wild :D | |
// USAGE: Put all pics in a 'pics' folder and create an empty 'crop' folder. Run Script. Enjoy. :D | |
$count=0; | |
echo "<h6>STARTED</h6>"; | |
foreach(glob('pics/{*.jpg,*.jpeg,*.png}', GLOB_BRACE) as $image) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var aws = require('aws-sdk'); | |
var config = require('./config.js'); | |
aws.config.update({accessKeyId: config.key, secretAccessKey: config.secret}); | |
aws.config.update({region: 'us-east-1'}); | |
var app = express(); | |
app.configure(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note that instance and class methods could also be defined at the adapter level | |
// (e.g. CRUD adapters add .save() and .destroy() methods, but the Twillio API might add a .call() method) | |
// User.js | |
module.exports = sails.Model.extend({ | |
// Adapters are applied from left to right | |
// (methods defined in more than one adapter use the rightmost adapter's version, just like _.extend) | |
adapter: ['mysql', 'twilio'], | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
/** | |
* | |
* Using raw socket.io functionality from a Sails.js controller | |
* | |
*/ | |
index: function (req,res) { |
OlderNewer