Skip to content

Instantly share code, notes, and snippets.


Juyal Ahmed tojibon

View GitHub Profile
jcsrb / gist:1081548
Created Jul 13, 2011
get avatar from google profiles, facebook, gravatar, twitter, tumblr
View gist:1081548
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
View slugify.js
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
mattn / dump.vim
Created Dec 6, 2011 — forked from ynkdir/dump.vim
View dump.vim
scriptencoding utf-8
let s:calendar_list = [
\ ['Australian Holidays', ''],
\ ['Austrian Holidays', ''],
\ ['Brazilian Holidays', ''],
\ ['Canadian Holidays', ''],
\ ['China Holidays', ''],
\ ['Christian Holidays', ''],
\ ['Danish Holidays', ''],
qsun / indexed.php
Created Jan 21, 2012
Check if URL is indexed by Google
View indexed.php
function indexed($url) {
$url = '' . 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');
navinpai / remove_9gag_watermark.php
Created May 20, 2012
Remove watermark/link from 9GAG Images
View remove_9gag_watermark.php
// Got bored/bugged of seeing the watermarks/Link at the bottom of 9GAG images. So wrote this script to remove them
// Eg.
// Very very basic PHP, but gets stuff done!
// Coded while listening to: :D
// USAGE: Put all pics in a 'pics' folder and create an empty 'crop' folder. Run Script. Enjoy. :D
echo "<h6>STARTED</h6>";
foreach(glob('pics/{*.jpg,*.jpeg,*.png}', GLOB_BRACE) as $image)
bradj / node-aws-dynamodb
Created Dec 19, 2012
Node.js AWS DynamoDB scan example
View node-aws-dynamodb
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();
View .bash_profile
# laravel new-app
alias laravel="git clone -o laravel -b develop"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package
mikermcneil / associations-proposal.js
Last active Apr 16, 2016
another proposal for instance methods and associations
View associations-proposal.js
// 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'],
mikermcneil / using-raw-socket-io-in-sails.js
Created Sep 17, 2013
Using raw functionality in a Sails.js controller
View using-raw-socket-io-in-sails.js
module.exports = {
* Using raw functionality from a Sails.js controller
index: function (req,res) {
JamesMGreene /
Last active Aug 4, 2021
A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository