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
''' | |
Bunch of functions to do basic image similarity detection | |
See: | |
http://www.gossamer-threads.com/lists/python/python/901273 | |
http://sourceforge.net/projects/imsim/?source=dlp | |
''' | |
from PIL import Image | |
from PIL import ImageStat |
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
// see See http://stackoverflow.com/questions/7563169/detect-which-word-has-been-clicked-on-within-a-text | |
$(".clickable").click(function(e) { | |
s = window.getSelection(); | |
var range = s.getRangeAt(0); | |
var node = s.anchorNode; | |
while (range.toString().indexOf(' ') != 0) { | |
range.setStart(node, (range.startOffset - 1)); | |
} | |
range.setStart(node, range.startOffset + 1); | |
do { |
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
# vim:syntax=apparmor | |
# | |
# Copyright (C) 2012 Lekensteyn <lekensteyn@gmail.com> | |
#include <tunables/global> | |
/opt/skype/skype { | |
#include <abstractions/kde> | |
#include <abstractions/nameservice> | |
#include <abstractions/video> | |
#include <abstractions/audio> |
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.path | |
p = lambda *x: os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', *x)) | |
# Main configuration goes here | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': True, | |
'formatters': { | |
'standard': { |
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
""" | |
Execute function in process/thread pool with possibility to get return values | |
credits to http://stackoverflow.com/a/8533626 | |
""" | |
from multiprocessing.pool import ThreadPool as Pool | |
# for process-based pool use | |
# from multiprocessing import Pool | |
import time |
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 | |
FILES=$(find $1 -maxdepth 1 -name '*.eps') | |
for file in $FILES | |
do | |
extension="${file##*.}" | |
filename="${file%.*}" | |
#echo $file | |
#echo $filename |
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
.loading { | |
position: relative; | |
} | |
.loading:before { | |
content: ""; | |
display: block; | |
position: absolute; | |
top: 0; | |
left: 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
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666" | |
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666" |
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
function getSelectionCoords(win) { | |
win = win || window; | |
var doc = win.document; | |
var sel = doc.selection, range, rects, rect; | |
var x = 0, y = 0; | |
if (sel) { | |
if (sel.type != "Control") { | |
range = sel.createRange(); | |
range.collapse(true); | |
x = range.boundingLeft; |
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
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/ | |
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]` | |
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file. | |
Now let’s extract the certificate: | |
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]` |
OlderNewer