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 | |
# Take a screenshot of an area of the screen, upload it to dropbox and put the url into the clipboard | |
# Put file in any directory under your dropbox | |
# If it is subfolder, than you need to make them manually | |
FILENAME=~/Dropbox/Public/Screenshots/Screenshot_`date +%Y-%m-%d-%H:%M`.png | |
# Select an area and save the screenshot | |
# you need to instal gnome-screenshot |
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/local/bin/zsh | |
echo $0 | |
echo $1 | |
echo $* | |
if [[ -n "$2" ]]; then | |
echo "Merging files" | |
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$* | |
echo "Saving $1" |
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
var gulp = require('gulp'); | |
var plumber = require('gulp-plumber'); | |
var sourceMaps = require('gulp-sourcemaps'); | |
var sass = require('gulp-sass'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var gulpIf = require('gulp-if'); | |
var cssnano = require('gulp-cssnano'); | |
var browserSync = require('browser-sync').create(); | |
var webpack = require('webpack-stream'); |
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/bash | |
cd /home/pi/teirproga | |
sudo python ./termo-regulation.py |
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 time | |
import datetime | |
import Adafruit_DHT | |
from relay import Relay | |
from subprocess import check_output | |
# te es definēju vēlamās temperatūras (DHT11 mēdz kļūdīties par +/- 1 grādu pēc Celsija) | |
maxTempNormal = 23 | |
maxTempHollyday = 20 |
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 Adafruit_DHT | |
while True: | |
try: | |
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.DHT11, 4) | |
print "Temperature: " + str(temperature) | |
except (KeyboardInterrupt, SystemExit): | |
print "\nInterrupted by user" | |
break |
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 hid | |
import re | |
class Relay: | |
def __init__(self, debug=False): | |
# USBrelay<relay-count> | |
self.vendor_id = 0x16c0 | |
self.product_id = 0x05df | |
self.debug = debug |
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
Problēmas apraksts: ir doti random skaits vienāda veida kvadrāti. Šos kvadrātus jāsakārto taisnstūra laukumā tā, lai būtu aizpildīts pilns taisnstūris un pāri paliktu pēc iespējas mazāk kvadrātu. Maksimālais X un Y dimensiju lielums ir 200 kvadrāti katrā dimensijā. | |
Piemērs: | |
Pieņemsim, ka max X un Y lielums ir 6. | |
Ir doti 10 kvadrāti. | |
Labākais sakārtošanas vieds būtu 5 kvadrāti pa vienu asi un 2 kvadrāti pa otru (pārpalikuma nav). | |
Ja liks pilnu 6x2, tad pāri paliks 4 kvadrāti. Ja liks 4x2, tad pāri palis 2 kvadrāti un līdzīgi. | |
Risinājums: vajadzētu daudz maz optimālu algoritmu, lai noteiktu vajadzīgās dimensijas, atmetot pēc iespējas mazāk kvadrātus. |
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
RewriteEngine On | |
RewriteBase /201504hokejaeksperti/ | |
# Redirect Trailing Slashes... | |
RewriteRule ^(.*)/$ /$1 [L,R=301] | |
# Handle Front Controller... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.php [L] |
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
ir ul li koks ar zariem, kas izveidojas dinamiski un dziļums var būt dažāds! | |
Vajag ar css pamainīt dziļākā ul fontu. | |
piemērs: | |
<style> | |
ul li { font-weight: bold} | |
</style> | |
<ul> | |
<li> | |
Pirmais |
NewerOlder