Skip to content

Instantly share code, notes, and snippets.

iAladdin /
Created May 22, 2020
compress encode and split a bulk file to many slices; sh filePath; sh filePath-ts-ala;
if [[ -n "$name" ]]; then
target="$( date +%s )"
tar -czvf $target $name
openssl des -in $target -out $encTarget
View Track CPU usage Top 10 over time
# --- Version history ---
# track cpu usage all the time. $1 is logfile name.
# --- Version history ---
# Usage: cputrack [PID] [filename]
# replace [PID] with process ID #
# replace [filename] with base file name to use (no extension)
filepath=/Users/ialaddin # modify as desired
interval=20 # reports per minute
timelimit=6000 # how long to run, in seconds
iAladdin / setproxy
Last active Jul 17, 2018 — forked from beradrian/setproxy
Set proxy for npm and git
View setproxy
# set a proxy
export HTTP_PROXY=
npm config set proxy $HTTP_PROXY
npm config set https.proxy $HTTPS_PROXY
npm config set https-proxy $HTTPS_PROXY
git config --global http.proxy $HTTP_PROXY
git config --global https.proxy $HTTPS_PROXY
# unset proxy
#!/usr/bin/env bash
export PATH
# System Required: CentOS 6+/Debian 6+/Ubuntu 14.04+
# Description: Install the ShadowsocksR server
# Version: 2.0.23
# Author: Toyo
# Blog:
iAladdin / GotchaYouriPhoneX.js
Last active Dec 6, 2021
Gotcha Your iPhone X
View GotchaYouriPhoneX.js
var rp = require('request-promise');
var moment = require('moment');
var storesURL = function(localtion){
return ''+localtion+'/zh_'+localtion+'/reserve/iPhoneX/stores.json';
var availabilityURL = function(localtion){
return ''+localtion+'/zh_'+localtion+'/reserve/iPhoneX/availability.json';
iAladdin / PrettyPrint.swift
Created Oct 8, 2017
Swift 4 - PrettyPrint
View PrettyPrint.swift
// PrettyPrint.swift
// Created by Aladdin on 08/10/2017.
// Copyright © 2017 Aladdin. All rights reserved.
import Foundation
public func prettyprint<T>(_ object: T, _ file: String = #file, _ function: String = #function, _ line: Int = #line) {
Swift.print("\(file.lastPathComponent):\(line) - \(function) | \(object)")
iAladdin /
Last active Mar 28, 2018
apps for new Mac
iAladdin / index.html
Created Apr 12, 2017 — forked from d3noob/.block
Collapsible tree diagram in v4
View index.html
<!DOCTYPE html>
<meta charset="UTF-8">
.node circle {
fill: #fff;
stroke: steelblue;
stroke-width: 3px;
iAladdin / DicLog.AppleScript
Last active Feb 28, 2017
Dictionary Logger
View DicLog.AppleScript
# © McUsr/MacUser06 2012
on run {input, parameters}
set glossaryName to "DictLogger.txt"
set AutomatorIcon to (a reference to file ((path to applications folder as text) & ""))
# checks to see if the current selection contains anything valid
considering diacriticals
if first character of (input as text) is not in "abcdefghijklmnopqrstuvwxyz" then
tell application "System Events" to set appname to name of first process whose frontmost is true
using terms from application "Finder"