Skip to content

Instantly share code, notes, and snippets.

{
"x": "--",
"function": "concat",
"y": {
"x": {
"function": "strreplace",
"x": {
"function": "lower",
"x": "[name]",
},
@filipekiss
filipekiss / git-delete-merged-branches
Last active April 4, 2023 11:39
Git utility to delete merged branches
Check https://github.com/filipekiss/bin/blob/main/git-delete-merged-branches for a better version
@filipekiss
filipekiss / spinner.sh
Created March 13, 2017 18:44
Bash Activity Indicator
#!/usr/bin/env bash
#
# A simple activity indicator for bash scripting.
# Optional message can be passed to spinner function.
# This can be used on interactive shells and in scripts
#
# Scripting usage:
#
# e_spinner "Import MySQL"
@filipekiss
filipekiss / autophoto.sh
Last active September 1, 2015 18:09
Takes a photo and screenshot. Just put this on your crontab.
#!/usr/bin/env bash
# Based on https://gist.github.com/DNA/7616b825261f97223953
# Improvements:
# - Capture up to 2 screens
# - Variable configuration for the binaries path
TODAY_SCREENCAPTURE_FOLDER="$HOME/Dropbox/Autophoto/screen/$(date +%Y%m%d)";
TODAY_SNAPS_FOLDER="$HOME/Dropbox/Autophoto/snaps/$(date +%Y%m%d)";
SCREENCAPTURE_BIN="/usr/sbin/screencapture"
@filipekiss
filipekiss / keybase.md
Created July 21, 2014 15:09
keybase.md

Keybase proof

I hereby claim:

  • I am filipekiss on github.
  • I am filipekiss (https://keybase.io/filipekiss) on keybase.
  • I have a public key whose fingerprint is A1F1 C366 BCDF E8FB 4830 045D 0BD3 425F 7E07 DA42

To claim this, I am signing this object:

@filipekiss
filipekiss / removeEmoji.php
Created June 3, 2014 19:28
Remove emojis
<?php
function remove_emoji($text){
return preg_replace('/([0-9|#][\x{20E3}])|[\x{00ae}|\x{00a9}|\x{203C}|\x{2047}|\x{2048}|\x{2049}|\x{3030}|\x{303D}|\x{2139}|\x{2122}|\x{3297}|\x{3299}][\x{FE00}-\x{FEFF}]?|[\x{2190}-\x{21FF}][\x{FE00}-\x{FEFF}]?|[\x{2300}-\x{23FF}][\x{FE00}-\x{FEFF}]?|[\x{2460}-\x{24FF}][\x{FE00}-\x{FEFF}]?|[\x{25A0}-\x{25FF}][\x{FE00}-\x{FEFF}]?|[\x{2600}-\x{27BF}][\x{FE00}-\x{FEFF}]?|[\x{2900}-\x{297F}][\x{FE00}-\x{FEFF}]?|[\x{2B00}-\x{2BF0}][\x{FE00}-\x{FEFF}]?|[\x{1F000}-\x{1F6FF}][\x{FE00}-\x{FEFF}]?/u', '', $text);
}
@filipekiss
filipekiss / server.php
Last active December 15, 2016 06:08
A server.php to emulate Apache's mod_rewrite
<?php
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$uri = urldecode($uri);
$requested = './'.$uri;
//Redirect if no trailing slash is found
@filipekiss
filipekiss / php-lint-pre-commit.sh
Created January 9, 2014 20:06
A *really* simple git pre-commit-hook that lints all staged PHP files.
#!/bin/bash
stagedFiles=$(git diff-index --cached HEAD | grep ".php" | grep "^:" | sed 's:.*[DAM][ \\''t]*\([^ \\''t]*\):\1:g');
phpLintErrors=0
echo "PHP will now lint all the php staged files..."
echo ""
for file in $stagedFiles
do
echo "PHP is linting $file...";
echo ""
php -l $file
@filipekiss
filipekiss / centipe.de
Last active January 17, 2023 01:01
Giant tropical centipedes share their territories with tarantulas. Despite it's impressive length, it's a nimble navigator, and some can be highly venomous. As quick as lightning, just like the tarantula it's killing, the centipede has two curved hollow fangs which inject paralyzing venom. Even tarantulas aren't immune from an ambush. This centi…
...\...../
....╚⊙ ⊙╝
..╚═(███)═╝
.╚═(███)═╝
╚═(███)═╝
.╚═(███)═╝
..╚═(███)═╝
...╚═(███)═╝
...╚═(███)═╝
..╚═(███)═╝
@filipekiss
filipekiss / _size.sass
Last active December 18, 2015 06:08
A simple mixin to generate font-size rules using rem and a px fallback. Read more here: http://snook.ca/archives/html_and_css/font-size-with-rem and here http://blog.typekit.com/2011/11/09/type-study-sizing-the-legible-letter/
=size($property , $size, $size-right: false, $size-bottom: false, $size-left: false)
@if $size == $size-bottom and $size-right == $size-left //Check if we can discard size-bottom
$size-bottom: false
@if $size-right == $size-left //If horizontal sizes are equal we only need one of the properties
$size-left: false
@if $size and $size-right == false //All equal
#{$property}: $size * 1px
#{$property}: $size * 0.1rem
@if $size and $size-right != false and $size-bottom == false // Vertical and Horizontal
#{$property}: $size * 1px $size-right * 1px