This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'normalize_url' | |
require 'rubygems' | |
require 'httpclient' | |
require 'net/http' | |
require 'uri' | |
def printer(text, value) | |
puts text + ": " + value.to_s | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Given an existing gulpfile.js without a package.json, runs `npm install` | |
# many times until all package required get installed | |
package_name=gulp | |
while [[ $package_name ]]; do | |
npm install $package_name | |
package_name=`gulp 2>&1 | grep "find module" | xargs | awk '{print $NF}'` | |
echo "Install $package_name" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Extracts all guid from an animation | |
extract_id_list() { | |
grep -o "guid: [0-9a-z]\+" $1 | grep -o "[0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z]\+" | xargs -n1 | sort -u | xargs | |
} | |
# Gives a meta file from it's guid | |
find_by_id() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style> | |
/* General setups */ | |
* { | |
box-sizing: border-box; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
YELLOW='\033[0;33m' | |
NC='\033[0m' | |
rm unused_files.log &> /dev/null | |
grep -r . --include=\*.meta --exclude=*{Editor,Gizmos}* -e 'guid' | while read line; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all leaders (people you follow that doesn't follow back) ordered by followers - followings. | |
# This is useful to identify people that never follow back. | |
t leaders -l | awk '{ print $12-$11,"\t",$13 }' | sort -k1,1nr -k2,2 | |
# Unfollow top ten people extracted by the previous command: | |
t leaders -l | awk '{ print $12-$11,"\t",$13 }' | sort -k1,1nr -k2,2 | awk '{print $2}' | head -10 | xargs t unfollow | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete empty folders recursively | |
find . -type d -empty -delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------- | |
-- Test connection to the internet | |
--------------------------------------- | |
local socket = require("socket") | |
local connection = {} | |
local function manual_test(callback, timeout) | |
if timeout == nil then timeout = 1000 end | |
local connection = assert(socket.tcp()) | |
connection:settimeout(0) |
NewerOlder