Skip to content

Instantly share code, notes, and snippets.

Karolis Daužickas kdauzickas

Block or report user

Report or block kdauzickas

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
View bench.do
SetActiveLib -work
comp -include "$dsn\src\Komponentai.vhd"
comp -include "$dsn\src\Naturali_Top.vhd"
comp -include "$dsn\src\TestBench\Naturali_Top_TB.vhd"
asim +access +r TESTBENCH_FOR_Naturali_top
wave
wave -noreg sinchr1
wave -noreg sinchr2
wave -noreg sinchr3
wave -noreg sinchr4
@kdauzickas
kdauzickas / one-way-sync.sh
Last active Aug 29, 2015
One way folder synchronisation. Changes in source are replicated at target. Changes at target stay there.
View one-way-sync.sh
#!/bin/sh
# Dir to watch
SOURCE_DIR="/tmp/source/"
# Dir to sync
TARGET_DIR="/tmp/target/"
inotifywait -mr --timefmt '%y-%m-%d %H:%M' --format '%T %w %f %e' \
-e modify \
-e attrib \
@kdauzickas
kdauzickas / helper.js
Created Jun 11, 2013
Handlebars {{#and}} helper. When you need variable amount of values to AND together.
View helper.js
// var context = {foo: true, bar: false, baz: true}
// {{#and foo baz}}Yup{{else}}Nope{{/and}} -> Yup
// {{#and bar baz qux}}Yup{{else}}Nope{{/and}} -> Nope
Handlebars.registerHelper('and', function() {
var fncType = toString.call(function(){});
for (var i = 0; i < arguments.length - 1; i++) {
var arg = arguments[i];
if (toString.call(arg) === fncType) {
arg = arg.call(this);
@kdauzickas
kdauzickas / helper.js
Last active Dec 18, 2015
Handlebars {{#or}} helper. When you need variable amount of values to OR together.
View helper.js
// var context = {foo: true}
// {{#or foo bar baz}}Yup{{else}}Nope{{/or}} -> Yup
// {{#or bar baz}}Yup{{else}}Nope{{/or}} -> Nope
Handlebars.registerHelper('or', function() {
var fncType = toString.call(function(){});
for (var i = 0; i < arguments.length - 1; i++) {
var arg = arguments[i];
if (toString.call(arg) === fncType) {
arg = arg.call(this);
@kdauzickas
kdauzickas / gravatar.sh
Created Mar 11, 2013
Use gravatar image as user image. Works with Fedora 18, not tested with any other distro/version
View gravatar.sh
#! /bin/bash
me=$(logname)
echo "Type in the email you use with gravatar: "
read email
md5=$(echo -n $email | md5sum | cut -f1 -d' ')
echo "Fetching image to /var/lib/AccountsService/icons/$me..."
wget --quiet http://www.gravatar.com/avatar/$md5?s=128 --output-document="/var/lib/AccountsService/icons/$me"
echo "Setting image..."
echo Icon=/var/lib/AccountsService/icons/$me >> /var/lib/AccountsService/users/$me
echo "Done"
You can’t perform that action at this time.