"time_range_start":
"time_range_end":
"time_range_start":
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 | |
"""Replacement for htpasswd""" | |
# Original author: Eli Carter | |
import os | |
import sys | |
import random | |
from optparse import OptionParser | |
# We need a crypt module, but Windows doesn't have one by default. Try to find |
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
""" | |
Gets the name of the active Git branch as a string. | |
Depends on GitPython | |
pip install GitPython | |
""" | |
from git import Repo | |
repo = Repo('/path/to/your/repo') | |
branch = repo.active_branch |
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
To answer that question, I'd like to describe member's accessors first in my own words. If you already know this, skip to the heading "next:". | |
There are three accessors that I'm aware of: public, protected and private. | |
Let: | |
class Base { | |
public: | |
int publicMember; | |
protected: |
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
public class BackgroundVideoRecorder extends Service implements SurfaceHolder.Callback { | |
private WindowManager windowManager; | |
private SurfaceView surfaceView; | |
private Camera camera = null; | |
private MediaRecorder mediaRecorder = null; | |
@Override | |
public void onCreate() { |
Power save
Min: 300 MHz
Max: 1036 MHz
Governor: INTERACTIVE
I/O scheduler: ROW
Cores: 0 and 3 only
Efficiency
Min: 300 MHz
total_bytes = os.stat('path/to/file').st_size
PROGRESS_BYTES = 0
def upload_callback(bytes, progress_bytes=PROGRESS_BYTES):
progress_bytes += bytes
sys.stdout.write('\r')
sys.stdout.write('part uploaded: %d of %d bytes' % (progress_bytes, total_bytes))
sys.stdout.flush()
with open(output_file, 'rb') as ouput_data:
NewerOlder