Skip to content

Instantly share code, notes, and snippets.

View salayhin's full-sized avatar
🎯
Focusing

Md. Sirajus Salayhin salayhin

🎯
Focusing
View GitHub Profile
@salayhin
salayhin / sitemap.php
Created May 31, 2012 19:48
Class for create sitemap in PHP
<?php
/**
* Create Site map
*
* @category Model
* @author Md. Sirajus Salayhin <[email protected]>
*
*/
@salayhin
salayhin / detect_browser_version.php
Created April 13, 2013 06:35
How to detect browser version.
$browsers = array(
'firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape',
'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol'
);
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$browser['useragent'] = $_SERVER['HTTP_USER_AGENT'];
$user_agent = strtolower($browser['useragent']);
foreach($browsers as $_browser) {
This file has been truncated, but you can view the full file.
-- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 16, 2013 at 12:29 PM
-- Server version: 5.5.29
-- PHP Version: 5.4.12-2~precise+1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
<select name="Country">
<option value="" selected="selected">Select Country</option>
<option value="United States">United States</option>
<option value="United Kingdom">United Kingdom</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<?php
/**
* Author Md. Sirajus Salayhin <[email protected]>
* Class for parsing number
*/
class Parser
{
<table align="center" style="width: 600px; height: auto; margin: 20px auto 0;">
<tr>
<td>
<a href="https://www.staff.com/"><img alt="Image" src="https://www.staff.com/newsletter/headerAugust.png"></a>
</td>
</tr>
<tr>
<td>
<img alt="Image" src="https://www.staff.com/newsletter/titleAugust.png">
</td>
# encoding: utf-8
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
before_filter :authenticate_user!, only: :stripe_connect
def facebook
auth = request.env['omniauth.auth']
@user = User.where(auth.slice('provider', 'uid')).first
if @user.present?
sign_in(@user, event: :authentication)
#!/bin/bash
if ! hash git &> /dev/null || ! hash php &> /dev/null; then
echo -e " *****\n ***** INSTALLING GIT AND PHP\n *****"
if hash apt-get &> /dev/null; then
sudo apt-get install git-core php5-cli php5-curl
elif hash port &> /dev/null; then
sudo port install php5-curl
elif hash fink &> /dev/null; then
import urllib
from BeautifulSoup import *
url = raw_input('Enter - ')
html = urllib.urlopen(url).read()
soup = BeautifulSoup(html)
# Retrieve all of the anchor tags
tags = soup('span')
# Note - this code must run in Python 2.x and you must download
# http://www.pythonlearn.com/code/BeautifulSoup.py
# Into the same folder as this program
import urllib
from BeautifulSoup import *
position = raw_input('Enter Position - ')
count = raw_input('Enter Count - ')