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/python3 | |
import argparse | |
import subprocess | |
import pprint | |
import os.path | |
import configparser | |
home = os.path.expanduser("~") | |
profiles_mozilla_path = home + r"/.mozilla/firefox" |
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/python3 | |
import argparse | |
import os | |
import pprint | |
import re | |
q = lambda string: '"' + string + '"' | |
pr = lambda obj: pprint.pprint(obj) |
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 | |
<?php | |
$shortArrayOnOneString = false; | |
$maxArrayOnOneStringLen = 60; | |
$convertToNumberIfPossible = false; | |
function _arrayLinesToString($lines, $indent){ | |
global $maxArrayOnOneStringLen; | |
global $shortArrayOnOneString; |
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
<?php | |
updateFieldNames = ['key1', 'key3']; | |
$filteredData = array_intersect_key($data, array_flip($updateFieldNames)); |
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/python3 | |
# change brightness level on all monitors simultaneously on linux ubuntu | |
import os | |
import re | |
from sys import argv | |
try: | |
brightness_level = float(argv[1]) | |
except IndexError: |
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
# File created by KDE Gtk Config | |
# Configs for GTK2 programs | |
include "/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc" | |
style "user-font" | |
{ | |
font_name="Ubuntu Regular" | |
} | |
widget_class "*" style "user-font" | |
gtk-font-name="Ubuntu Regular 12" |
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
>>> | |
def t(*args): | |
return p(*args) | |
>>> | |
def p(*args): | |
i = 0 | |
for arg in args: | |
i += 1 | |
print('i='+str(i)+': '+str(arg)) |
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
## original is on https://gist.github.com/reedobrien/701444 | |
## it's newer version (works on python 3) | |
## code may contain bugs, check carefully | |
import deform | |
import deform.widget | |
from deform.widget import CheckedInputWidget | |
from colander import null, Invalid | |
from pyramid.threadlocal import get_current_request |
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
# schema | |
class LoginSchema(Schema): | |
login = SchemaNode( | |
String(), | |
title='Login', | |
widget=TextInputWidget(), | |
) | |
password = SchemaNode( |
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
function pyv() { | |
. ./venv/bin/activate | |
which python | |
python --version | |
} |