Skip to content

Instantly share code, notes, and snippets.

View bunlongheng's full-sized avatar
💭
🍔 Eat. 🛌 Sleep. 💻 Code --> ☕️🧑🏻‍💻

Bunlong Heng bunlongheng

💭
🍔 Eat. 🛌 Sleep. 💻 Code --> ☕️🧑🏻‍💻
View GitHub Profile
# --------------------------------------------------------------
# Goal : Remove file base on input match
# Run : curl 45.55.88.57/code/fileModifier.py | python3
import os
import sys
rootdir = os.path.abspath(os.curdir)
print(rootdir)
console.log("Environment variables----------------")
let variables = pm.environment.toObject();
console.log(variables)
console.log(typeof (variables)) //object
Object.keys(variables).forEach(function(key) {
console.log(key, variables[key]);
});
console.log("-------------------------------------")
set recipientName to "Zuse" set recipientAddress to "sybunlongheng@gmail.com" set theSubject to "Subject" -- leave empty set theContent to "https://picsum.photos/200/300/?random" 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 tell end tell
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf 8">
<title>Guru99</title>
</head>
<body ng-app="app">
<h1 ng-controller="HelloWorldCtrl">{{message}}</h1>
<script src="https://code.angularjs.org/1.6.9/angular.js"></script>
<script src="app.js"></script>
#!/bin/bash
function check_compression {
curl -I -H 'Accept-Encoding: gzip,deflate' $1 |grep "Content-Encoding"
}
check_compression http://www.bunlongheng.com/ ;
path="/home/benu/backup"
if [ -d $path ]
then
echo "Directory $path exists."
echo "Remove old path"
rm -rf $path
echo "Create new path"
mkdir $path
@bunlongheng
bunlongheng / rank.php
Last active March 1, 2019 18:54
10/1/2015
function containsKey($key_para, $array)
{
foreach ($array as $key => $value) {
if ($key_para === $key) {
return true;
}
}
return false;
}
@bunlongheng
bunlongheng / SkillController.php
Last active March 1, 2019 18:53
Sample Laravel + Angular CRUD Controller
<?php
namespace App\Http\Controllers;
use App\Skill;
use Input, Validator, Auth, Redirect, Request, Session, Mail, View, Image;
class SkillController extends Controller {
//------------------------------------------------------------------------------------------------- [ all ]
<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->
<head>
@include('layouts.be.meta')
@include('layouts.be.links')
</head>
<body>
@bunlongheng
bunlongheng / ImageController.php
Last active March 1, 2019 18:52
Sample Laravel CRUD Controller
<?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 ]