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 python | |
""" | |
An example of how to remove comments and trailing commas from JSON before | |
parsing. You only need the two functions below, `remove_comments()` and | |
`remove_trailing_commas()` to accomplish this. This script serves as an | |
example of how to use them but feel free to just copy & paste them into your | |
own code/projects. Usage:: | |
json_cleaner.py some_file.json |
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
import os, re, sys | |
comments_re = re.compile( | |
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', | |
re.DOTALL | re.MULTILINE | |
) | |
trailing_commas_re = re.compile( | |
r'(,)\s*}(?=([^"\\]*(\\.|"([^"\\]*\\.)*[^"\\]*"))*[^"]*$)') | |
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
/* | |
* This file is part of the libopencm3 project. | |
* | |
* Copyright (C) 2009 Uwe Hermann <[email protected]> | |
* Copyright (C) 2011 Stephen Caudle <[email protected]> | |
* | |
* This library is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. |
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 python | |
""" | |
Example of how to use futures with ProcessPoolExecutor or ThreadPoolExecutor. | |
""" | |
from concurrent import futures | |
def long_running_function(): | |
""" |
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/python | |
# -*- coding: utf-8 -*- | |
from random import Random | |
ⶻ=len | |
ج=int | |
ⶽ=sum | |
ܠ=str | |
ܓ=range | |
ش=object | |
import sys |
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 python | |
""" | |
shiftreg.py | |
Shift register control module. Provides the :class:`Shiftter` class which | |
makes it easy to control shift registers. | |
.. note:: |
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
// I pasted this without even looking at it. It the code running in the video here: http://youtu.be/OZ_9Yg0PG3M | |
// The video is of an Arduino controlling a single 8x8 LED matrix via an MBI5026 chip + a single 74HC595 shift register. | |
// Link to the MBI5026: http://www.rayslogic.com/propeller/programming/AdafruitRGB/MBI5026.pdf | |
#define SDI 10 | |
#define CLK 9 | |
#define LE 8 | |
#define LED 17 | |
// 74HC595 | |
#define SHSDI 3 // DS (pin 14 on shift register) |
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 python | |
""" | |
Split up and remove duplicate CA certificates from a bundle (e.g. | |
ca-bundle.crt). | |
.. note:: | |
This script will preserve comments and certificate metadata at | |
the expense of possibly missing duplicates (that don't have the |
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 python3 | |
""" | |
A periodic callback mechanism that uses `threading.Timer`. | |
""" | |
class PeriodicTimerCallback(object): | |
""" | |
A wrapper that uses either `threading.Timer` to call functions at a |
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
oclHashcat Benchmarks | |
System Info: | |
CPU: Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz (quad core) | |
GPU: XFX Core Edition R7-265A-CNF4 Radeon R7 265 2GB (1280 stream processors) | |
NetNTLMv2 Benchmark first (since I consider it the most important) | |
------------------------------------------------------------------ | |
$ ./oclHashcat64.bin -b --force -m5600 |
NewerOlder