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
| Array::uniq = (cmp = null)-> | |
| arr = this.slice(0) | |
| if typeof(cmp) == 'function' | |
| arr.sort(cmp) | |
| else | |
| arr.sort() | |
| i = 0 | |
| size = arr.length | |
| while i < size | |
| while true |
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/sh | |
| # chmod 666 /var/mails.txt | |
| # all mails will be stored in this file | |
| MAILS_FILE='/var/mails.txt' | |
| while read x | |
| do | |
| echo $x >> $MAILS_FILE | |
| 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
| #!/usr/bin/env ruby | |
| # encoding: UTF-8 | |
| # show create tables from a database | |
| require 'mysql2' | |
| m = Mysql2::Client.new :username => 'root', :password => '', :host => 'localhost', :database => 'dbname' | |
| result = m.query("SHOW TABLES").collect do |row| | |
| table = row['Tables_in_dbname'] |
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 | |
| # add_item.sh | |
| expect << EOF | |
| spawn telnet localhost 6379 | |
| send "SELECT 10\n" | |
| expect "OK" | |
| send "SADD items \"${1}\"\n" | |
| expect ".*" |
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
| nohup soffice --headless --nofirststartwizard --accept="socket,port=8100;urp" & |
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 'mysql' | |
| db = Mysql.new('webdb', 'root', 'pa$$', 'home') | |
| db.query("SHOW TABLES LIKE '%home%'").each do |row| | |
| tb_status = db.query("CHECK TABLE #{row[0]}").fetch_row | |
| puts tb_status.join("\t") | |
| end | |
| db.close |
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
| echo 8.8.8.8 >> /etc/resolv.conf | |
| echo 8.8.4.4 >> /etc/resolv.conf | |
| apt-get update | |
| apt-get install \ | |
| gcc \ | |
| g++ \ | |
| nmap \ | |
| tree \ |
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
| Warning: Invalid argument supplied for foreach() in /data/vhosts/xunlei.com/xmp.kankan/public_html/xmp_search_v2.php on line 943 | |
| Warning: Invalid argument supplied for foreach() in /data/vhosts/xunlei.com/xmp.kankan/public_html/xmp_search_v2.php on line 210 |
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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'mysql' | |
| conn = Mysql::connect("localhost", "redmine", "redmine", "redmine") | |
| conn.list_tables.each do |table| | |
| conn.query("ALTER TABLE `#{table}` CONVERT TO CHARACTER SET 'UTF8'") | |
| end | |
| conn.close | |
| puts "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
| http://mobile.tutsplus.com/category/tutorials/android/ |