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
@biplobice
biplobice / up-to-php7-in-cloud9.sh
Created May 10, 2017 09:09 — forked from shingorow/up-to-php7-in-cloud9.sh
On Cloud9, upgrade PHP 5 to 7.
# Install phpbrew
sudo apt-get update
sudo apt-get install libmcrypt-dev
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew
sudo mv phpbrew /usr/local/bin/
phpbrew init
[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
@biplobice
biplobice / install-ffmpeg-amazon-linux.sh
Created May 18, 2017 09:22 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@biplobice
biplobice / site_post.php
Last active June 19, 2017 08:17 — forked from hissy/site_post.php
[concrete5] [Legacy] Export only scrapbook proxy blocks
<?php
/* config/site_post.php */
$req = Request::get();
if ($req->getRequestPath() == 'export_scrapbook_proxies') {
$root = new SimpleXMLElement("<concrete5-cif></concrete5-cif>");
$root->addAttribute('version', '1.0');
$pages = $root->addChild("pages");
// Get all active scrapbook proxy blocks
@biplobice
biplobice / README.md
Created July 21, 2017 01:55 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@biplobice
biplobice / git-cheat-sheet.md
Created February 22, 2018 10:21 — forked from iansheridan/git-cheat-sheet.md
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:

@biplobice
biplobice / sphp.sh
Last active January 9, 2019 11:58 — forked from rhukster/sphp.sh
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.5","5.6","7.0","7.1","7.2", "7.3")
php_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]")
valet_support_php_version_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]")
php_installed_array=()
php_version="php@$1"
@biplobice
biplobice / app.php
Created May 13, 2020 06:08 — forked from katzueno/app.php
concrete5 Environment switch according to host name
<?php
// /application/bootstrap/app.php
Route::register('/ccm/request_test', function() {
header("Pragma: no-cache");
echo '<dl>';
?><dt>Application environment:</dt><dd><?php echo ($this->app->environment()) ? $this->app->environment() : 'default'; ?></dd><?php
$request = \Concrete\Core\Http\Request::getInstance();
?><dt>Client IP:</dt><dd><?php echo $request->getClientIp(); ?></dd><?php
?><dt>Host:</dt><dd><?php echo $request->getHost(); ?></dd><?php
?><dt>Port:</dt><dd><?php echo $request->getPort(); ?></dd><?php
@biplobice
biplobice / curl.md
Created October 19, 2020 08:41 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@biplobice
biplobice / gist:bd11c0fa5cb5ca08c043c8a42faa7f72
Created May 31, 2021 05:36 — forked from samarpanda/gist:4125105
Test your php code execution time and Memory usage
<?php
// from http://php.net/manual/en/function.filesize.php
function formatBytes($bytes, $precision = 2) {
$units = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
@biplobice
biplobice / git-archive-patch.sh
Created March 31, 2022 02:58 — forked from josh-taylor/git-archive-patch.sh
Creates an archive of all files changed in a git repository since a given commit.
#!/bin/bash
# Explains how to use the script
usage()
{
cat << EOF
usage: $0 options
$0 -o output_file.zip commit_from [commit_to]