This file contains 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
" DO WHAT THE **** YOU WANT TO PUBLIC LICENSE | |
" Version 2, December 2004 | |
" | |
" Copyright (C) 2013 ZwodahS([email protected]) | |
" zwodahs.wordpress.com | |
" | |
" Everyone is permitted to copy and distribute verbatim or modified | |
" copies of this license document, and changing it is allowed as long | |
" as the name is changed. | |
" |
This file contains 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
c_cyan=`tput setaf 6` | |
c_red=`tput setaf 1` | |
c_green=`tput setaf 2` | |
c_sgr0=`tput sgr0` | |
parse_git_branch () | |
{ | |
if git rev-parse --git-dir >/dev/null 2>&1 | |
then | |
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p') |
This file contains 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
std::string& replaceString(std::string& newString, const std::string& searchString, const std::string& replaceString, const bool& multipleReplace) | |
{ | |
size_t index = newString.find(searchString); | |
if(multipleReplace) | |
{ | |
while(index != std::string::npos) | |
{ | |
// replace | |
newString.replace(index, searchString.size(), replaceString); | |
// start searching from the end of the replaceString, such that the replaceString will never be part of the search |
This file contains 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
//// General stuffs //// | |
initscr(); // "start curses" | |
endwin() ; // "end curses" | |
//// Windowing //// | |
WINDOW* window = newwin(height, width, startY, startX) | |
//// Draw /// | |
refresh() | |
wrefresh(window) |
This file contains 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
def generate_maze(x, y, config={}): | |
structure = [] | |
for i in range(x): | |
l = [] | |
for j in range(y): | |
l.append(6) | |
structure.append(l) | |
maze = { | |
"x" : x, |
This file contains 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
/* | |
* DO WHAT THE F*** YOU WANT TO PUBLIC LICENSE | |
* Version 2, December 2004 | |
* | |
* Copyright (C) 2013- ZwodahS([email protected]) | |
* zwodahs.github.io | |
* | |
* Everyone is permitted to copy and distribute verbatim or modified | |
* copies of this license document, and changing it is allowed as long | |
* as the name is changed. |
This file contains 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
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
# SOFTWARE. | |
# | |
# Author : Eric (github.com/ZwodahS) | |
# License : Public Domain |
This file contains 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
""" | |
data_matrix.py | |
Author: Eric | |
github: ZwodahS | |
data_matrix is a simple modules that helps you count on a N-dimension matrix. | |
terminology: |
This file contains 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 | |
# source http://stackoverflow.com/questions/23222616/copy-all-keys-from-one-db-to-another-in-redis | |
#set connection data accordingly | |
source_host=localhost | |
source_port=6379 | |
source_db=1 | |
target_host=localhost | |
target_port=6379 | |
target_db=2 |
This file contains 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 | |
# git + ls | |
C_RED=$(tput setaf 1) | |
C_GREEN=$(tput setaf 2) | |
C_YELLOW=$(tput setaf 3) | |
C_BLUE=$(tput setaf 4) | |
C_MAGENTA=$(tput setaf 5) | |
C_CYAN=$(tput setaf 6) | |
C_WHITE=$(tput setaf 7) | |
C_CLEAR=$(tput sgr0) |
OlderNewer