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 | |
/** | |
Load a gravatar. | |
*/ | |
function gravatar($email = '', $rating = 'pg') { | |
$default = "path/to/defava.png"; // Set a Default Avatar | |
$email = md5(strtolower(trim($email))); | |
$gravurl = "http://www.gravatar.com/avatar/$email?d=$default&s=60&r=$rating"; | |
return '<img src="'.$gravurl.'" width="60" height="60" border="0" alt="Avatar">'; |
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
# | |
# Inspired by | |
# http://dev.rubyonrails.org/svn/rails/plugins/account_location/lib/account_location.rb | |
# | |
module SubdomainAccounts | |
def self.included( controller ) | |
controller.helper_method(:account_domain, :account_subdomain, :account_url, :current_account, :default_account_subdomain, :default_account_url) | |
end | |
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
# coding: utf-8 | |
require 'sinatra' | |
set server: 'thin', connections: [] | |
get '/' do | |
halt erb(:login) unless params[:user] | |
erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
end | |
get '/stream', provides: 'text/event-stream' do |
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
require 'hub' | |
run Sinatra::Application |
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
require 'hub' | |
run Sinatra::Application |
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 | |
echo "<h1>PHP Code to find the common alphabets in AMITABH BACHCHAN and RAJNIKANTH</h1>"; | |
$string1 = "AMITABH BACHCHAN"; | |
$string2 = "RAJNIKANTH"; | |
$a1 = strlen($string1); | |
$a2 = strlen($string2); | |
echo "common alphabets in AMITABH BACHCHAN AND RAJNIKANTH are :\n"; | |
for($i = 0;$i<$a1;$i++) | |
{ | |
for($j=0;$j<$a2;$j++) |
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
/* | |
* L.TileLayer is used for standard xyz-numbered tile layers. | |
*/ | |
L.Google = L.Class.extend({ | |
includes: L.Mixin.Events, | |
options: { | |
minZoom: 0, | |
maxZoom: 18, | |
tileSize: 256, |
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
wget https://github.com/downloads/github/hubot/hubot-1.1.9.tar.gz | |
tar zxvf hubot-*.tar.gz | |
cd hubot | |
vim Procfile | |
app: bin/hubot -a gtalk -n Hubot | |
vim bin/hubot | |
#npm install | |
#heroku logs will be more silence the error if remove the npm install from bin/hubot | |
git init |
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
require "sinatra/base" | |
require "sinatra/namespace" | |
require "multi_json" | |
require "api/authentication" | |
require "api/error_handling" | |
require "api/pagination" | |
module Api | |
class Base < ::Sinatra::Base |
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 | |
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php | |
/** | |
* The root directory where the repos live. | |
* | |
* @var string | |
*/ | |
$root_dir = '/your/root/dir/'; |
OlderNewer