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
class Touch_name(FlaskForm): | |
name = SelectField(coerce=str) | |
submit = SubmitField("Register") | |
def __init__(self, defLang='en', *args, **kwargs): | |
super(Touch_name, self).__init__(*args, **kwargs) | |
self.name.label = gtranslator.translate("Select one of the following options :", 'en', [defLang]) | |
self.name.choices = [(t[0], gtranslator.translate(t[1], 'en', [defLang])) for t in [ | |
("First option", "First option"), | |
("Second option", "Second option"), |
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
{% macro beloadingNotifier(version, beload=True, firefox="firefox", release="new release") %} | |
<!-- | |
Simple macro to load beloading for fading and browser_notifier for | |
firefox confirmation and new release confirmation | |
--> | |
<script src="{{ url_for('static', filename='beloading.js') }}"></script> | |
<script src="{{ url_for('static', filename='browserNotifier.js') }}"></script> | |
<script type='text/javascript'> | |
$(document).ready(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
const getUUID = ( | |
service='https://api.ipify.org/?format=json', | |
key='ip' | |
) => { | |
return new Promise( | |
(resolve, reject) => { | |
fetch(service) | |
.then((r) => r.json()) | |
.then((j) => { | |
let r = /\D+/g |
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 python2.7 | |
# -*- coding: utf-8 -*- | |
# | |
# Sending a SMS with Python and pyserial via an USB 3G Modem on pfSense/FreeBSD | |
# tested with: Huawei Technologies Co., Ltd. E620 USB Modem | |
# and a Telekom SIM card | |
import serial | |
from curses import ascii | |
import time |
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
@echo off | |
rem Latest update 13 march 2015 .. Fixing bug in retrieving files from USB | |
rem #head | |
:head | |
setlocal enabledelayedexpansion | |
:tm | |
rem The number of temproray files is 6 | |
set /a sn=6 | |
set /a an=an+1 | |
if !an! gtr !sn! ( goto :body ) |
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
;; Put system to sleep, if emacs idle for 1 hour | |
(defun gotoSleep () | |
(interactive) | |
(minibuffer-message "Going to Sleep !") | |
(shell-command "systemctl suspend") | |
) | |
(run-with-idle-timer (* 60 60) nil 'gotoSleep) |
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
#!/bin/bash | |
tmp_file=/tmp/redshifted | |
max_tem=7000 | |
if [ ! -f $tmp_file ];then echo $max_tem > $tmp_file ;fi | |
current_tem=$(cat $tmp_file) | |
function get_percentage () { | |
echo Redshift $(( $current_tem * 100 / $max_tem ))/100 | |
} |
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
#!/bin/bash | |
config_file=/sys/class/backlight/intel_backlight/brightness | |
brightness=$(cat $config_file) | |
max_brightness=100000 | |
brightness_measure=$(( max_brightness / 10 )) | |
function get_percentage() { | |
percent=$(( $brightness * 100 / $max_brightness )) | |
echo Brightness: $percent/100 | |
} |
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
backend = "glx"; | |
glx-no-rebind-pixmap = true; | |
shadow = false; | |
menu-opacity = 0.8; | |
inactive-opacity = 0.7; | |
active-opacity = 1; | |
frame-opacity = 0.9; | |
inactive-opacity-override = true; | |
alpha-step = 0.06; | |
blur-background = true; |
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
#!/bin/bash | |
d=$1 # Directory | |
t=$2 # Duration | |
if [ "$1" == "" ];then | |
d=~/Pictures/Cities | |
fi | |
if [ "$2" == "" ];then | |
t=300 # 5 minuts | |
fi |