Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sumardi Shukor sumardi

🏠
Working from home
View GitHub Profile
View Uninstall_brew_package_and_dependencies.md

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
View brew-deep
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
View app\Http\Controllers\Employee\ShowController.php
<?php
.
.
.
public function show(Employee $employee)
{
// $employee->load('projects');
// Cara 1
$employee = $employee->with('projects')->first();
View fetch_json_api.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,
@sumardi
sumardi / angularjs-providers-explained.md
Created July 10, 2016 04:30 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
View angularjs-providers-explained.md
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@sumardi
sumardi / php.ini
Created August 11, 2015 19:52
Fixing composer memory_limit on DigitalOcean droplet
View php.ini
cd /var
touch swap.img
chmod 600 swap.img
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
mkswap /var/swap.img
swapon /var/swap.img
free
View keybase.md

Keybase proof

I hereby claim:

  • I am sumardi on github.
  • I am sumardi (https://keybase.io/sumardi) on keybase.
  • I have a public key whose fingerprint is 6085 8A97 69AD 9949 30A5 D10F 80D7 1397 3FD6 D917

To claim this, I am signing this object:

@sumardi
sumardi / Gruntfile.js
Created March 21, 2014 04:02
Building Pebble watchapps with Grunt and Grunt-Shell.
View Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
phoneIP: '192.168.1.100',
// set logs: '' to turn off logging
logs: '--logs',
shell: {
buildAndInstall: {
options: {
stdout: true,
stderr: true
@sumardi
sumardi / gist:8922624
Created February 10, 2014 19:35
Build your OWN Apple iBeacon with a Raspberry Pi.
View gist:8922624
$ sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
$ sudo wget www.kernel.org/pub/linux/bluetooth/bluez-5.14.tar.xz
$ sudo unxz bluez-5.14.tar.xz
$ sudo tar xvf bluez-5.14.tar
$ cd bluez-5.14
$ sudo ./configure --disable-systemd
$ sudo make
$ sudo make install
@sumardi
sumardi / gist:8920355
Created February 10, 2014 17:25
TP-LINK TL-WN725N working on Raspberry Pi
View gist:8920355
$ 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