Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# --- 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
iAladdin / setproxy
Last active July 17, 2018 06:41 — forked from beradrian/setproxy
Set proxy for npm and git
# set a proxy
export HTTP_PROXY=
export HTTPS_PROXY=$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
@iAladdin
iAladdin / index.html
Created April 12, 2017 09:41 — forked from d3noob/.block
Collapsible tree diagram in v4
<!DOCTYPE html>
<meta charset="UTF-8">
<style>
.node circle {
fill: #fff;
stroke: steelblue;
stroke-width: 3px;
}
@iAladdin
iAladdin / GAME_MASTER_v0_1.protobuf
Created July 17, 2016 01:44 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@iAladdin
iAladdin / creator-debug-scripts.md
Last active June 2, 2016 09:44 — forked from jareguo/creator-debug-scripts.md
运行时 Creator 调试工具集

在收藏夹中新增一个网页,将网址设为下面的其中一个源码。然后打开任一 Creator 页面,接着直接在收藏夹点击刚刚收藏的网址即可。

打印 Hierarchy

javascript:(function () {
    function visitNode (node, visitor) {
        visitor(node);
        var children = node._children;
 for (var i = 0; i &lt; children.length; ++i) {
@iAladdin
iAladdin / build.sh
Created April 23, 2012 04:06 — forked from jonah-williams/build.sh
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
@iAladdin
iAladdin / TestflihtappDeployTeamcity.sh
Created April 23, 2012 04:06 — forked from JohannesRudolph/TestflihtappDeployTeamcity.sh
Builds and deploys an App to testflightapp.com. Integrates with Teamcity.
#!/bin/bash
#
# testflightapp.com tokens
API_TOKEN="YOUR_API_TOKEN"
TEAM_TOKEN="YOUR_TEAM_TOKEN"
PRODUCT_NAME="RowMotion"
ARTEFACTS="$PWD/Artefacts"
@iAladdin
iAladdin / gist:2342551
Created April 9, 2012 09:41 — forked from kavu/gist:1023207
Net::HTTP::Patch
require 'net/http'
require 'json'
class Net::HTTP::Patch < Net::HTTPRequest
METHOD = 'PATCH'
REQUEST_HAS_BODY = true
RESPONSE_HAS_BODY = true
end
url = URI.parse('https://api.github.com/iAladdin')
@iAladdin
iAladdin / .gitignore
Created August 19, 2011 05:21 — forked from ErikEvenson/.gitignore
Xcode 4 .gitignore file
.DS_Store
*.swp
*~.nib
build/
*.pbxuser
*.perspective
*.perspectivev3