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
| def dscan(w, h): | |
| """ scans a 2-dimensions array of width 'w', height 'h', in diagonal, starting at the upper-left corner. | |
| example for w=3,h=3 : | |
| +---+---+---+ | |
| |000|002|003| | |
| |001|004|007| | |
| |005|006|008| | |
| +---+---+---+ |
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
| IC : | |
| Jenkins | |
| Sonar | |
| Git : Giblit | |
| Project: | |
| https://github.com/taigaio |
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
| #recipe from https://milkator.wordpress.com/2014/07/19/windows-executable-from-python-developing-in-ubuntu/ | |
| # allows to cross-compile a window(32bits) .exe out of a python script under linux. | |
| cat > test.py <<< EOF | |
| print "hello world !" | |
| EOF | |
| apt-get install scons wine | |
| git clone https://github.com/pyinstaller/pyinstaller |
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
| dd if=/dev/zero of=swapfile bs=1024 count=6553600 | |
| mkswap swapfile | |
| swapon swapfile |
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 | |
| start=$1 | |
| end=$2 | |
| command=$3 | |
| outputfile=$4 | |
| delay=10 | |
| rm -rf /tmp/outputToGif 2>/dev/null | |
| mkdir -p /tmp/outputToGif |
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 groovy | |
| /*######################################################################*/ | |
| //Configuration | |
| /** username & password for proxy authentication */ | |
| username = "user" | |
| password = "p@zzW0rD" | |
| /** Location of the Proxy configuration file (http://, and file:// urls are supported) */ |
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
| def get_intersection(line1, line2): | |
| xdiff = (line1[0][0] - line1[1][0], line2[0][0] - line2[1][0]) | |
| ydiff = (line1[0][1] - line1[1][1], line2[0][1] - line2[1][1]) #Typo was here | |
| def det(a, b): | |
| return a[0] * b[1] - a[1] * b[0] | |
| div = det(xdiff, ydiff) | |
| if div == 0: | |
| return None | |
| d = (det(*line1), det(*line2)) | |
| p = det(d, xdiff) / div, det(d, ydiff) / div |
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
| def simplify_path(p): | |
| direction = p[1][0]-p[0][0], p[1][1]-p[0][1] | |
| yield p[0] | |
| current = p[1] | |
| if len(p)>2: | |
| for pos in p[2:]: | |
| rdir = pos[0]-current[0], pos[1]-current[1] | |
| if direction != rdir: | |
| yield current | |
| current = pos |
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
| FREE_TCP_PORT=`python -c "from socket import*;s=socket(AF_INET,SOCK_STREAM);s.bind(('',0));s.listen(1);print s.getsockname()[1];s.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
| #!/usr/bin/env python2 | |
| # -*- encoding:utf-8 -*- | |
| import sys | |
| import os | |
| import os.path | |
| import smtplib | |
| from email.mime.base import MIMEBase | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.text import MIMEText |
OlderNewer