Skip to content

Instantly share code, notes, and snippets.

View biplobice's full-sized avatar
🖥️
while (success!==true) { keepMovingForward(); }

Md Biplob Hossain biplobice

🖥️
while (success!==true) { keepMovingForward(); }
View GitHub Profile
@iansheridan
iansheridan / git-cheat-sheet.md
Created March 15, 2011 14:25
A cheat sheet for GIT

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@cam-gists
cam-gists / memoryuse.php
Created July 28, 2012 07:00
PHP: Memory Usage Class
<?php
/**
* MEMORY USAGE CLASS
* @REF: http://www.if-not-true-then-false.com/2011/php-memory-usage-information-class/
*/
class MemoryUsageInformation {
private $real_usage;
private $statistics = array();
// Memory Usage Information constructor
@plasticbrain
plasticbrain / gist:3863749
Created October 10, 2012 07:34
PHP: (REGEX/preg_match) check for http(s)://
//--------------------------------------------------------------------------
// See if a url contains http:// or https://
//--------------------------------------------------------------------------
if( !preg_match('/http(s?)\:\/\//i', $url) ) {
// URL does NOT contain http:// or https://
}
@gibbs
gibbs / currency_symbols.php
Last active April 3, 2024 10:09
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@tawfekov
tawfekov / generator.php
Last active March 2, 2024 16:06
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();
@stefanschmidt
stefanschmidt / uninstall-parallels7-ml.sh
Last active July 13, 2020 05:45
Completely Uninstall Parallels Desktop 7 on OS X 10.8 (Mountain Lion)
# Unload all Parallels kernel extensions
for kext in $(kextstat | grep parallels | awk '{print $6}'); do kextunload -v 1 -b $kext; done
# Delete all Parallels kernel extensions
rm -v /System/Library/Extensions/prl*
# Delete all other Parallels files
rm -vr \
/Applications/Parallels\ Desktop.app \
/Library/Parallels/Parallels\ Service.app \
@irazasyed
irazasyed / headers.php
Last active October 13, 2021 16:51
PHP HTTP Headers (Examples)
<?php
# Source: http://www.jonasjohn.de/snippets/php/headers.htm
// Use this header instruction to fix 404 headers
// produced by url rewriting...
header('HTTP/1.1 200 OK');
// Page was not found:
header('HTTP/1.1 404 Not Found');
@irazasyed
irazasyed / bash_profile.md
Last active March 7, 2023 15:10
Terminal: Mac OS X Terminal Aliases & How-To - .bash_profile / .profile

Mac OS X Terminal Aliases & How-To

Collection of some of my fav terminal aliases that I use often & collected from the web. This file will be updated with more aliases as I find more. Feel free to comment and share your fav aliases you use :)

Follow these simple steps to add them to your shell env.

  1. Within the Terminal, run: vim ~/.bash_profile
  2. Type i and then paste the following at the top of the file: