Skip to content

Instantly share code, notes, and snippets.

Slawomir Jasinski slav123

Block or report user

Report or block slav123

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@slav123
slav123 / keylock.ino
Created Mar 6, 2019
Arduino double relay keypad lock
View keylock.ino
#include <Keypad.h>
#define PasswordLength 5
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
{'1','2','3', 'A'},
{'4','5','6', 'B'},
{'7','8','9', 'C'},
@slav123
slav123 / aupostcode2state.js
Created Jul 24, 2018
Australian Postcode to state conversion
View aupostcode2state.js
function returnState(postcode) {
var postcode = parseInt(postcode, 10);
if ((postcode >= 1000 && postcode <=1999) || (postcode >= 2000 && postcode <= 2599) || (postcode >=2619 && postcode <= 2899) || (postcode >= 2921 && postcode <= 2999)){
return 'NSW';
} else if ((postcode >= 200 && postcode <= 299) || (postcode >= 2600 && postcode <= 2618) || (postcode >= 2900 && postcode <= 2920)) {
return 'ACT';
} else if ((postcode >= 3000 && postcode <= 3999) || (postcode >= 8000 && postcode <= 8999)) {
return 'VIC';
} else if ((postcode >= 4000 && postcode <= 4999) || (postcode >= 9000 && postcode <= 9999)) {
return 'QLD';
@slav123
slav123 / wget
Created May 28, 2018
full website wget
View wget
wget --recursive --no-clobber --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains webthemez.com --no-parent https://webthemez.com/demo/custom-best-interior-design-website-template/
@slav123
slav123 / gist:2075589367aa526cce6ef0aaf68aba75
Created Mar 8, 2018 — forked from bds/gist:2207826
Convert files from .scss to .sass
View gist:2075589367aa526cce6ef0aaf68aba75
sass-convert -F scss -T sass application_styles.css.scss application_styles.css.sass
@slav123
slav123 / post.go
Created Mar 5, 2018
send data via POST golang
View post.go
package main
import (
"fmt"
"net/http"
"net/url"
"strconv"
"strings"
)
@slav123
slav123 / bash.sh
Created Mar 4, 2018
redis php directadmin
View bash.sh
wget https://github.com/phpredis/phpredis/archive/develop.zip
unzip develop.zip
cd phpredis-develop/
/usr/local/php70/bin/phpize
./configure --with-php-config=/usr/local/php70/bin/php-config
make && make install
/usr/local/php70/lib/php.conf.d/
cp 10-opcache.ini 10-redis.ini
@slav123
slav123 / caddy.conf
Created Mar 3, 2018
Caddy with features
View caddy.conf
pricewatch.io www.pricewatch.io 104.198.194.205 {
#startup service php70-php-fpm start
#shutdown service php70-php-fpm stop
expires {
match .css$ 1m # expires
match .js$ 1m # expires
match .png$ 1m # expires
match .jpg$ 1m #expires # expires
match .webp$ 1m
@slav123
slav123 / rename.sh
Created Jan 8, 2018
batch raname max os x
View rename.sh
for f in *.png; do echo mv "$f" "${f/_*_/_}"; done
@slav123
slav123 / move.sh
Created Jan 8, 2018
find files in subdirectories and move to one location
View move.sh
find ./ -name '*.JPG' -exec cp {} /Volumes/NO\ NAME/2014 \;
You can’t perform that action at this time.