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
| # -- https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Disable_touchpad_on_mouse_detection | |
| # /etc/udev/rules.d/01-touchpad.rules | |
| SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/username/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=1" | |
| SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/username/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=0" |
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
| install ubuntu 14.04.4 | |
| install software update | |
| ### disable guest login | |
| -- http://askubuntu.com/questions/451526/removing-guest-session-at-login-in-ubuntu-14-04 | |
| sudo sh -c "echo 'allow-guest=false' >> /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf" | |
| # tahoma as system font | |
| download http://www.mediafire.com/download/zjk13nnyizd/tahoma_font.zip | |
| extract |
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
| -- This is a Hive program. Hive is an SQL-like language that compiles | |
| -- into Hadoop Map/Reduce jobs. It's very popular among analysts at | |
| -- Facebook, because it allows them to query enormous Hadoop data | |
| -- stores using a language much like SQL. | |
| -- Our logs are stored on the Hadoop Distributed File System, in the | |
| -- directory /logs/randomhacks.net/access. They're ordinary Apache | |
| -- logs in *.gz format. | |
| -- | |
| -- We want to pretend that these gzipped log files are a database table, |
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
| var el = document.getElementsByTagName('input'); | |
| for (var i=0; i<el.length; i++) { el[i].checked = 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/bash | |
| fn=$1 | |
| if [ "$2" == "" ] || [ "$3" == "" ]; then | |
| if [ -f last_${fn}.txt ]; then | |
| value=$(<last_${fn}.txt) | |
| _yy=${value:0:4} | |
| _mm=${value:4:2} | |
| echo "$_yy $_mm" |
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
| // ref: http://stackoverflow.com/questions/1184334/get-number-days-in-a-specified-month-using-javascript | |
| // ref: http://stackoverflow.com/questions/16353211/check-if-year-is-leap-year-in-javascript | |
| function daysInMonth(year, month) { | |
| var isLeapYeaer = new Date(year, 1, 29).getMonth() == 1; | |
| return [31, (isLeapYeaer ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; | |
| } |
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
| for /r "C:\tmp\DCIM" %x in (*.jpg) do move "%x" "C:\tmp\pic" |
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
| package main | |
| import ( | |
| "net/http" | |
| "log" | |
| ) | |
| func main() { | |
| log.Println("Static server listening on port 5555...") | |
| http.ListenAndServe(":5555", http.FileServer(http.Dir("D:/dev/static"))) |
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
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| func Sqrt(x float64) float64 { | |
| z := 1.0 | |
| // var a,b,c,d,e float64 |
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
| /* | |
| Tampermonkey script for pantip.com | |
| This is my white theme for pantip topic page. Useful for me while reading it. | |
| ## How to use? | |
| 1. Install tampermonkey chrome extension (https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) | |
| 2. Refresh this page | |
| 3. Open any pantip topic page | |
| */ |