Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# This script will automatically export all the Balsamiq mock files to PDF and bundle them up
# into a nice PDF. Just drop this script into the folder containing the mock files and
# execute it from the command-line
#
# For the PDF to work, you'd need to install "prawn" and "prawn-fast-png" gem, otherwise the PDF
# creation will be very slow.
#
# Currently this script has been tested with Balsamiq Next.161 build (05/28/2010)
require 'net/ftp'
CONTENT_SERVER_DOMAIN_NAME = "one-of-the-ftp-server.thought-sauce.com.hk"
CONTENT_SERVER_FTP_LOGIN = "saucy-ftp-server-login"
CONTENT_SERVER_FTP_PASSWORD = "saucy-ftp-server-password"
# LOGIN and LIST available files at default home directory
Net::FTP.open(CONTENT_SERVER_DOMAIN_NAME, CONTENT_SERVER_FTP_LOGIN, CONTENT_SERVER_FTP_PASSWORD) do |ftp|
files = ftp.list
@IceskYsl
IceskYsl / puma _nginx.conf
Created April 22, 2014 05:00
nginx conf for puma
upstream redmine {
server unix:///var/run/redmine.sock;
}
server {
listen 80;
server_name work.eoemobile.com; # change to match your URL
root /datas/www/redmine/current/public; # I assume your app is located at this location
location / {
#
# lib/mongoid/counter_cache.rb
# ruby
#
# Created by Zhang Alex on 2011-06-17.
# Copyright 2011 __ZhangHanDong__. All rights reserved.
#
# ===================================
# class Forum
# references_many :topics
@IceskYsl
IceskYsl / kill_mysql_lock.sh
Created September 25, 2012 04:23
kill add locked mysql process~
for id in `mysqladmin processlist | grep -i locked | awk '{print $1}'`
do
mysqladmin kill ${id}
done
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> Learning about Bacjbone.js </title>
</head>
<body>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone-min.js"></script>
<script type="text/javascript">
@IceskYsl
IceskYsl / dropbox_hosts
Created June 13, 2012 01:52
the hosts for dropbox
#sudo vi /etc/hosts
#C:\WINDOWS\system32\drivers\etc\hosts
208.43.202.50 www.dropbox.com
174.129.11.212 dl.dropbox.com
184.73.163.57 dl-web.dropbox.com
publicbooleanonKeyDown(intkeyCode, KeyEventevent) {
if ((keyCode==KeyEvent.KEYCODE_BACK) &&mWebView.canGoBack()
{ mWebView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
@IceskYsl
IceskYsl / wp-xml-import.rb
Created April 26, 2012 02:39 — forked from zanshin/wp-xml-import.rb
WordPress to Markdown ruby script. Parses existing WP categories into discreet list of categories. Also identifies link-style postings and sets a YAML attribute to identify those entries. Finally forces all content to be UTF-8.
require 'fileutils'
require 'date'
require 'yaml'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
FileUtils.mkdir_p "_posts"
@IceskYsl
IceskYsl / statusesfriends_timeline.json
Created February 25, 2012 13:09
获取当前登录用户及其所关注用户的最新微博
{ "hasvisible" : false,
"next_cursor" : 3417063424927923,
"previous_cursor" : 0,
"statuses" : [ { "comments_count" : 3,
"created_at" : "Sat Feb 25 21:03:20 +0800 2012",
"favorited" : false,
"geo" : null,
"id" : 3417063983118436,
"idstr" : "3417063983118436",
"in_reply_to_screen_name" : "",