Skip to content

Instantly share code, notes, and snippets.

View FirePanther's full-sized avatar
👨‍💻
hi ✌️

Suat Secmen FirePanther

👨‍💻
hi ✌️
View GitHub Profile
@FirePanther
FirePanther / ToDo-FinderTag.sh
Last active December 10, 2016 02:58
This cron shell script automatically adds a ToDo Finder Tag to all files, which contains a comment like "// todo: replace"
# you will need https://github.com/jdberry/tag for finder tags (and correct the path)
{
grep -rlIi --null -E -e "(\#|//|/\*\*?)\s*todo\b" --exclude-dir="Library" --exclude-dir="node_modules" --include=\*.{php,js,css,htm,html} "$HOME" | xargs -0 .../execs/tag -a "ToDo"
} &> /dev/null
@FirePanther
FirePanther / speedtest.php
Created January 11, 2017 14:15
Quickly compare the speed of multiple functions
<?php
/**
* Example output:
* function: file_exists(__FILE__);
* time: 1.39806 seconds
* speed: 39.248 %
*
* function: is_file(__FILE__);
* time: 0.3417 seconds
* speed: 85.152 %
@FirePanther
FirePanther / .eslintrc.json
Created September 3, 2018 22:59
my eslint rules and settings
{
"env": {
"browser": true
},
"parserOptions": {
"ecmaVersion": 5
},
"rules": {
"no-undef": 0,
"no-cond-assign": [
<?php
// @author: su.at (made for myself)
class Hue {
private static $ip = '___ADD-HUE-IP-ADDRESS-HERE___';
private static $user = '___ADD-USER-ID-HERE___';
// private methods
private static function request($method, $api, $body) {
$url = self::$user.'/'.$api;
<?php
$settings = [];
// svg file
if (isset($_GET['svg'])) {
// general/custom svg file
$svgFile = DIR_ASSETS.'/cdn/dist/svg/'.$_GET['svg'];
if (!preg_match('~^\w[\w/-]+\.svg$~', $_GET['svg']) || !file_exists($svgFile)) die('Invalid svg');
} elseif (isset($_GET['fa'])) {
// fontawesome icon
@FirePanther
FirePanther / auto-tagger.sh
Created December 1, 2022 00:17
Automatically (macOS-Finder) tag folders, hide them, or exclude them from spotlight and iCloud sync (e.g. node_modules)
#!/bin/bash
# requires: brew install tag
# you can change the source, for me the script is run by my Mac Mini server which only has to tag iCloud Drive documents
source="$HOME/Library/Mobile Documents/com~apple~CloudDocs"
# delete all tags once per day to clean up (if a project doesn't fit anymore)
if [ `date +"%H"` = 0 ]; then
tags=( "Git" "Node" "React" "VueJS" )