Skip to content

Instantly share code, notes, and snippets.


Bunlong Heng bunlongheng

View GitHub Profile
# --------------------------------------------------------------
# Goal : Remove file base on input match
# Run : curl | python3
import os
import sys
rootdir = os.path.abspath(os.curdir)
View loopThroughAnObject.js
console.log("Environment variables----------------")
let variables = pm.environment.toObject();
console.log(typeof (variables)) //object
Object.keys(variables).forEach(function(key) {
console.log(key, variables[key]);
View sendEmail. applescript.applescript
set recipientName to "Zuse"set recipientAddress to ""set theSubject to "Subject" -- leave empty set theContent to ""tell application "Mail" ##Create the message set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true} ##Set a recipient tell theMessage make new to recipient with properties {name:recipientName, address:recipientAddress} ##Send the Message send end tellend tell
View angularjs.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf 8">
<body ng-app="app">
<h1 ng-controller="HelloWorldCtrl">{{message}}</h1>
<script src=""></script>
<script src="app.js"></script>
function check_compression {
curl -I -H 'Accept-Encoding: gzip,deflate' $1 |grep "Content-Encoding"
check_compression ;
if [ -d $path ]
echo "Directory $path exists."
echo "Remove old path"
rm -rf $path
echo "Create new path"
mkdir $path
View rank.php
function containsKey($key_para, $array)
foreach ($array as $key => $value) {
if ($key_para === $key) {
return true;
return false;
bunlongheng / SkillController.php
Last active Mar 1, 2019
Sample Laravel + Angular CRUD Controller
View SkillController.php
namespace App\Http\Controllers;
use App\Skill;
use Input, Validator, Auth, Redirect, Request, Session, Mail, View, Image;
class SkillController extends Controller {
//------------------------------------------------------------------------------------------------- [ all ]
View be.master.blade.php
<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->
bunlongheng / ImageController.php
Last active Mar 1, 2019
Sample Laravel CRUD Controller
View ImageController.php
namespace App\Http\Controllers;
use App\ImageWork;
use Input, Validator, Auth, Redirect, Request, Session, Mail, View, File, Image, SSH;
class ImageController extends Controller {
//------------------------------------------------------------------------------------------------- [ Index ]