Skip to content

Instantly share code, notes, and snippets.

@amitkeret
amitkeret / .gitconfig
Last active December 16, 2015 05:59
Master .gitconfig file
[user]
name = Name Here
email = [email protected]
[gitweb]
owner = Name Here
[core]
editor = nano
whitespace = cr-at-eol
eol = lf
autocrlf = input
@amitkeret
amitkeret / loader-etg.pug
Last active February 3, 2018 06:49
eTG-inspired loader, pure HTML (pug) + CSS (stylus)
#etg-loader: .loader
each i in [0,1,2,3]
div
// https://codepen.io/anon/pen/MQKZWq
#loader-wrapper: #loader
@amitkeret
amitkeret / app.coffee
Last active May 6, 2018 13:16
radiology slices scroller app
q = (q)-> document.querySelector q
qa = (q)-> document.querySelectorAll q
createImgTag = (url) ->
img = document.createElement 'img'
img.src = url
q '#slices-container'
.appendChild img
imgIndex = 0
@amitkeret
amitkeret / Toggle_.dot_notation.sh
Created December 29, 2018 09:48
Nautilus script - Toggle .dot notation
for file in $NAUTILUS_SCRIPT_SELECTED_URIS; do
file_name=$(echo $file | sed -e 's/file:\/\///g' -e 's/\%20/\ /g' -e 's/.*\///g')
file_folder=$(echo $file | sed -e 's/file:\/\///g' -e 's/\%20/\ /g' -e "s/$file_name//g")
case "$file_name" in
.*)
new_file_name=$(echo $file_name | sed -e 's/\.//')
;;
*)
new_file_name=".$file_name"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@amitkeret
amitkeret / image.styl
Created March 25, 2019 10:24
responsive blurred image background
body
display flex
.image
width 30vw
height 80vh
margin auto
position relative
overflow hidden
&::before
&::after
@amitkeret
amitkeret / browser-preprocess.html
Created June 22, 2019 09:06
Quick-and-dirty on-the-fly CoffeeScript + Stylus compiling in the browser
<html>
<head>
<title></title>
<meta charset="UTF-8">
<style language="stylus">
body
h1
color red
</style>
</head>
@amitkeret
amitkeret / background.pug
Created December 8, 2019 04:54
CSS block element blurred background
.wrapper.card1
.title Quia voluptas voluptatem sit
.text Ea eius cum dolor facere sequi. Veritatis architecto fugiat rerum maxime. Cupiditate facere explicabo corrupti. Aliquid voluptas vel sequi fugiat adipisci sit ut
.wrapper.card2
.title Sint eveniet repellendus fuga
.text Eveniet animi neque ipsum nihil rerum laboriosam. Quod fugiat quis inventore laudantium qui doloremque. Ea et autem sed
@amitkeret
amitkeret / sensors.py
Last active May 2, 2022 12:21
simplified RPi system sensors MQTT announcements (incl. Home Assistant auto-discovery)
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Simplified RPi system sensors MQTT announcements
# Inspired by the great work done by @Sennevds
#
# This script is meant to be executed via crontab.
# It does NOT maintain a persistent connection and/or employ a loop function to keep sending messages at defined intervals.
# Therefor, in order to make use of the LWT function, added the keepAlive flag to the connecion.
#