Skip to content

Instantly share code, notes, and snippets.

View sumardi's full-sized avatar
🏠
Working from home

Sumardi Shukor sumardi

🏠
Working from home
View GitHub Profile
@sumardi
sumardi / nginx.default.conf
Last active November 3, 2023 18:49
Install PHP-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
@sumardi
sumardi / vacancies.md
Last active March 3, 2023 22:41
I'm hiring Web and Android Application Developer. (Fulltime position)

1. Web Application Developer

You’re brilliant, we’re hiring. Pretty simple, right? Well, kinda.

About Us

  • We are a small startup with a big idea and based in Cyberjaya, Malaysia.
  • Our team is made up of young, passionate personalities built around a enthusiasm to be the best.
  • We are not big on employee handbooks. Wear jeans or a t-shirt on most days – we don’t care. But, there will be occasions when you need to represent the company with class.
  • Our development projects are typically built on PHP (the LAMP stack) and are often using Laravel. You don’t need to know those to join our team, as long as you’re experienced with another MVC framework (such as CakePHP, Codeigniter or Zend).
@sumardi
sumardi / gist:5559896
Created May 11, 2013 12:56
Subdirectory checkouts with Git sparse-checkout
# New repository
mkdir <repo> && cd <repo>
git init
git remote add –f <name> <url>
git config core.sparsecheckout true
echo some/dir/ >> .git/info/sparse-checkout
echo another/sub/tree >> .git/info/sparse-checkout
git pull <remote> <branch>
# Existing repository

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package:

@sumardi
sumardi / brew-deep
Created September 24, 2019 22:05
Homebrew : List packages and what uses them
brew list -1 | while read cask; do echo -ne "\x1B[1;34m $cask \x1B[0m"; brew uses $cask --installed | awk '{printf(" %s ", $0)}'; echo ""; done
@sumardi
sumardi / gist:8920355
Created February 10, 2014 17:25
TP-LINK TL-WN725N working on Raspberry Pi
$ sudo apt-get install linux-headers
$ sudo ln -s /usr/src/linux-headers-3.10-3-rpi/ /lib/modules/3.10.25+/build
$ git clone https://github.com/lwfinger/rtl8188eu.git
$ cd rtl8188eu
$ make all
$ sudo make install
$ sudo ifconfig wlan0 up
@sumardi
sumardi / gist:1519364
Created December 25, 2011 14:33
iPhoneDev - Detect double tap on the UIWebView
// Add <UIGestureRecognizerDelegate> in *.h file
- (void)viewDidLoad
{
UITapGestureRecognizer *singleFingerDTap = [[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(handleDoubleTap:)];
singleFingerDTap.numberOfTapsRequired = 2;
singleFingerDTap.delegate = self;
[self.webView addGestureRecognizer:singleFingerDTap];
[singleFingerDTap release];
@sumardi
sumardi / gist:3819725
Created October 2, 2012 14:47
Installing OAuth extension
cd /usr/local/directadmin/custombuild
wget http://pecl.php.net/get/oauth
tar xvzf oauth-1.2.3.tgz
cd oauth-1.2.3
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config
make
make test
make install
cp modules/oauth.so /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
@sumardi
sumardi / gist:3936651
Created October 23, 2012 04:26
Laravel nginx config
server {
listen 80;
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
root /var/www/example.com;
index index.php;
// $url = urlencode ("http://domain/path/to/json");
// $json = json_decode(file_get_contents($url), true);
// dd($json);
$url = "https://atsbopis.asuscomm.com:8446/html/stats/rest/index.php?entity=realtime";
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,