Skip to content

Instantly share code, notes, and snippets.

@Haraguroicha
Haraguroicha / usernameE2C.js
Created July 3, 2012 15:17
Change Username form an Array's data to another Array's data
//========== method 1 ==========
var Ename = array("Aname", "Bname", "Cname", "Dname");
var Cname = array("A名", "B名", "C名", "D名");
function usernameE2C1(urn, eArray, cArray) {
if(eArray == undefined) eArray = Ename;
if(cArray == undefined) cArray = Cname;
if(eArray.length != cArray.length) return "";
for(var i = 0; i <= eArray.length; i++)
if(eArray[i] == urn)
@Haraguroicha
Haraguroicha / ics.applescript
Created August 22, 2012 19:16
Internet Sharing preferences flipper for zh-TW Mac OS X
set preferencesWindowTitle to "共享"
set btnOpenWiFi to "開啟 Wi-Fi"
set btnActivate to "啟動"
set successfulText to "Internet 共享已經成功切換"
set someWrongText to "Oops...有些錯誤噢~!"
set btnOK to "好"
tell application "System Preferences"
activate
reveal (pane id "com.apple.preferences.sharing")
@Haraguroicha
Haraguroicha / gist:3879341
Created October 12, 2012 14:06 — forked from anonymous/gist:3877708
親戚小孩住我家,卻要我們養,這樣是對的嗎?
//親戚小孩住我家,卻要我們養,這樣是對的嗎?
// fork and convert to JavaScript by Haraguroicha 2012/10/12 23:27
//Aee jo / 2012-10-12 00:31 #1
var us = "us";
//我們家有個遠親不是很熟,最近幾年發財了,一直都很看不起我們
//在外面叫所有的其他親戚跟我們斷絕往來,欺負我們好多年了
caterCousin.fortune = true;
caterCousin.despise = { us };
@Haraguroicha
Haraguroicha / fbEdgeRank.js
Created December 1, 2012 19:12
Get Facebook's friends order list by Haraguroicha
/***********************************
* Title: Get Facebook's friends order list (EdgeRank)
* Author: Haraguroicha
* Date: 2012/12/3
* Version: 0.7
* See also: http://edgerank.net/
* http://unwire.hk/2012/12/02/fb-friend-rank/news/
* http://garylai1990.tumblr.com/post/36953217144/facebook
*
* NOTE: You can just run this in your browser's console tab to using latest version of this script
@Haraguroicha
Haraguroicha / upup_ss.js
Last active January 26, 2016 08:22
change custom dimension for up up. ref: http://small-upup.upuptoyou.com/ Note: this is paste and run in DevTools console panel
(function(){
//以下可自行修改,目前可7行且最多14字
var userWidth = 900; //我是寬度
var userHeight = 680; //我是高度
var userWords = ''; //我是預設文字
var userColor = ''; //我是背景色彩
//以下請勿修改
if(location.href.match(/https?:\/\/small-upup\.upuptoyou\.com\/?/) != null) {
$('#words').val(userWords === '' ? 'Modify By:\n腹黒い茶 \nQQQQ QQQQ !!\nQ Q Q Q !!\nQ QQ Q QQ !!\nQQQQ QQQQ\n Q Q !!' : userWords);
using System;
using System.Text;
namespace HanzawaNaoki {
class Program {
static void Main(string[] args) {
Console.OutputEncoding = new UnicodeEncoding();
Console.WindowWidth = 120;
Console.WriteLine(new HanzawaNaoki(1));
Console.WriteLine(new HanzawaNaoki(2));
// Haraguroicha Hsu
// 2014-07-04
function findNearlyMaximum(arrayValue) {
var queueNegitive = function(q) {
var neg = false;
for(var i = 0; i < q.length; i++)
if(q[i] < 0) neg = !neg;
return neg;
}
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
@echo off
for /f "delims=^" %%a in ('dir /a-d /b /s "C:\Program Files\ospp.vbs" "C:\Program Files (x86)\ospp.vbs" 2^> nul ^| findstr /i vbs') do set ospp=cscript "%%a"
%ospp% %*
@Haraguroicha
Haraguroicha / showModalDialog.js
Created March 23, 2016 01:03
alternative function of showModalDialog for Chrome
///========================================
/// showModalDialog.js
///
/// Created by Haraguroicha 2014-10-06
///========================================
(function() {
window._smdName = window._smdName || Math.round(Math.random() * 1000000000);
window.spawn = window.spawn || function(gen) {
function continuer(verb, arg) {
var result;