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 | |
| query_yn() { | |
| local res="" | |
| echo -n "$1: [y,n] " | |
| while [ "$res" != "n" -a "$res" != "y" ]; do | |
| read -s -n 1 res | |
| done | |
| if [ "$res" != "n" ]; then | |
| echo |
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 | |
| # Copyright Alex Cornejo 2013 | |
| # Released under BSD License | |
| generate_icons() { | |
| local SRC_FILE=$1 | |
| local DST_DIR=$2 | |
| declare -a argSIZES=("${!3}") | |
| for size in "${argSIZES[@]}"; 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
| #include <iostream> | |
| #include <evt> | |
| using std::cout; | |
| // create custom mouse move event | |
| struct MouseMoveEvent: public evt::Event { | |
| int x; | |
| int y; | |
| MouseEvent(int _x, int _y): evt::Event("mousemove"), x(_x), y(_y) {} |
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
| function clone(obj) { | |
| // Handle the simple types (string, number, boolean, undefined, null) | |
| if (obj === null || typeof obj !== 'object') return obj; | |
| var copy; | |
| // Handle Date | |
| if (obj instanceof Date) { | |
| copy = new Date(); | |
| copy.setTime(obj.getTime()); | |
| return copy; |