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 sys | |
if len(sys.argv) < 2: | |
print("""Usage: | |
pick.py data.txt [lines_to_skip = 0] [first_line = 0]""") | |
sys.exit(0) | |
file = sys.argv[1] | |
skip = int(sys.argv[2]) + 1 if len(sys.argv) > 2 else 1 | |
start = int(sys.argv[3]) if len(sys.argv) > 3 else 0 |
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 os, sys, re | |
dir = sys.argv[1] if len(sys.argv) > 1 else "files" | |
find = sys.argv[2] if len(sys.argv) > 2 else "<\?\n" | |
set_to = sys.argv[3] if len(sys.argv) > 3 else "<?PHP\n" | |
exts = sys.argv[4] if len(sys.argv) > 4 else "\.php|\.txt" | |
pattern = re.compile(find, re.I | re.M | re.S) | |
if not os.path.isdir(dir): |
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 -i | |
sudo mount -o remount,rw /cdrom | |
mount -l|grep /dev/sd | |
setxkbmap hu | |
#sudo ifconfig wlan0 up | |
#sudo wpa_passphrase HDF $(head -c 63 wpa_key.txt) > /tmp/wpa.conf | |
#sudo iwconfig wlan0 essid HDF | |
#sudo wpa_supplicant -B -iwlan0 -c /tmp/wpa.conf -Dwext -W | |
#sudo dhclient wlan0 | |
read -t 10 |
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
from PIL import Image, ImageGrab | |
import cv2, numpy | |
img = cv2.cvtColor(numpy.array(ImageGrab.grab()), cv2.COLOR_RGB2BGR) | |
template = cv2.cvtColor(numpy.array(Image.open('PS/3C.png')), cv2.COLOR_RGB2BGR) | |
d, w, h = template.shape[::-1] | |
res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED) | |
#all matches: |
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
// Ennek a fájlnak a letöltési linkje: | |
// https://gist.github.com/hdf/2a4f01f24c1f74bd48252ee297ed53b2 | |
// Felfedezendő terület vizuális paraméter generáló: https://gist.github.com/hdf/63f5f088d11039972778 | |
// Linux alatti építés és futtatás (ha nincs fönt g++: "sudo apt-get install g++"): | |
// g++ -O3 -fopenmp RKF7_4D_heterokl_Dll.cpp -o judit1 | |
// chmod +x ./judit1 | |
// ./judit1 -MMM 10 -t 1300 -o eredmeny.txt | |
// less ./eredmeny.txt | |
// (less -ből való kilépéshez nyomd meg a q billentyűt.) |
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
namespace ProgressViewer { | |
partial class Form1 { | |
/// <summary> | |
/// Required designer variable. | |
/// </summary> | |
private System.ComponentModel.IContainer components = null; | |
/// <summary> | |
/// Clean up any resources being used. | |
/// </summary> |
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
//NAND logic gate (and others) with only exponentiation. | |
/* | |
Exponentiation: 13 | |
0^0 1 | |
0^1 0 | |
1^0 1 | |
1^1 1 | |
NAND: 7 |
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
// Extension project for: https://github.com/joshaven/string_score/ | |
// See: https://github.com/joshaven/string_score/issues/28 | |
/** | |
* Gives back an array of indexes of the unique closest matches, | |
* on a string array to a string. | |
* 'Hello World'.closest(['el', 'll', 'o', 'll']); //=> [ 0, 1 ] | |
*/ | |
String.prototype.closest = function(words, fuzziness, one2many) { | |
'use strict'; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Random Map</title> | |
</head> | |
<body> | |
<canvas id="map" style="border: solid 1px black;"></canvas> | |
<script> | |
var canvas = document.getElementById('map'); |
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
alias b='unset HISTFILE' | |
alias c='sudo apt-get autoremove && sudo apt-get autoclean' | |
alias i='sudo apt-get install' | |
alias u='sudo apt-get purge' | |
alias ..='cd ..' |