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
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Random; | |
public class MasterMind { |
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
#!/usr/bin/env python3 | |
import glob | |
import pathlib | |
import sys | |
jdks = {} | |
jdks.update(dict([(x.name, x) for x in pathlib.Path('/usr/local/opt').glob('openjdk@*')])) | |
jdks.update(dict([(x.parent.parent.name, x) for x in pathlib.Path('/Library/Java/JavaVirtualMachines').glob('*/Contents/Home')])) |
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
#!/usr/bin/env python2.7 | |
import sys | |
import os | |
import popen2 | |
import re | |
import shutil | |
import pytz | |
import imghdr | |
from datetime import datetime |
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 | |
VERSION=3.7.0 | |
sudo apt-get update -y | |
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y | |
wget https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz | |
tar xf Python-$VERSION.tar.xz | |
cd Python-$VERSION | |
./configure | |
make -j 2 | |
sudo make altinstall |
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
#!/usr/bin/env python | |
import os, os.path | |
import argparse | |
parser = argparse.ArgumentParser(description='Find orphan files based on the extension and move them into directory') | |
parser.add_argument('--dir', nargs='?', default=os.getcwd(), help='Directory to process (default CWD)') | |
parser.add_argument('--dest', nargs='?', default='orphans', help='Destination directory (default orphans)') | |
parser.add_argument('--delete', action='store_true', default=False, help='Delete files instead of backing them up') | |
parser.add_argument('--sensitive', action='store_true', default=False, help='Case sensitive for extensions') |
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
# Version 1.1 | |
__get_hg_dir() { | |
local d=`readlink -f "$1"` | |
if [ -d "$d/.hg" ]; then | |
echo "$d/.hg" | |
return 0 | |
elif [ "$d" == "/" ]; then | |
echo "" | |
return 1 |
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
/* | |
* Benchmarks of Java 8 | |
*/ | |
package benchmarks; | |
import java.util.concurrent.TimeUnit; | |
import java.util.function.Supplier; | |
import org.openjdk.jmh.annotations.BenchmarkMode; |
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
#!/usr/bin/python | |
# -*- coding: iso-8859-1 -*- | |
__version__ = "$Revision: 0.1 $" | |
__author__ = "Pierrick Terrettaz" | |
__date__ = "2007-08-15" | |
import argparse, subprocess | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser(description='JPEG Keywords') |
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
#!/usr/bin/env python | |
import sys, argparse, random | |
start = ord('.') | |
end = ord('Z') | |
modulo = (end - start) + 1 | |
def alphabet(): | |
return reduce(lambda a, b: '%s%s' % (a,b), map(lambda x: chr(x), range(start, end+1))) |
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
#!/usr/bin/python | |
import csv, sys | |
from math import sin | |
from collections import Counter | |
class Player: | |
def __init__(self, name): | |
self.name = name | |
self.points = 0 |
NewerOlder