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 / amazonmailsToGoogleCalendar.gs
Last active November 17, 2016 04:08
Google Apps Script
function myFunction() {
var calendar = CalendarApp.getCalendarsByName('[a] delivery')[0],
threads = GmailApp.search('from:[email protected]'),
msg, matchDate, matchProduct,
months = [ 'jan', 'feb', 'mär', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dez' ],
delivDay, delivMonth, delivYear;
Logger.log("Threads: " + threads.length);
for (var x in threads) {
Logger.log("Found thread: " + threads[x].getFirstMessageSubject());
msg = threads[x].getMessages();
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export EDITOR=nano
export ANDROID_HOME=/usr/local/opt/android-sdk
##################
# export PS1='\033]0;$PWD\007\[\033[01;31m\]\u\[\033[m\] \[\e[34;1m\]\w \[\033[m\]\$ \[\033[m\]'
@FirePanther
FirePanther / arrayparser.php
Last active November 17, 2016 04:06
Parses the array, sind it up/combines it with dots, written for @bluefirex
<?php
$a = [
"some" => [
"thing" => [
"is" => [
"happening" => [
50, 20, 90
]
]
],
@FirePanther
FirePanther / parse_interface.php
Last active November 17, 2016 04:02
Parse Interface File for Linux, written for @patschi
<?php
function parse_interface($data) {
// remove comments
$data = preg_replace('~\#.*$~m', "\n", $data);
preg_match_all('~\nauto\s+(\w+)\niface \1 inet (\w+)\n([ \t]+.+\n)*~', $data, $m, PREG_SET_ORDER);
$result = [];
foreach ($m as $v) {
$iface = [];
function parseBanks() {
var calendar = CalendarApp.getCalendarsByName('[a] Banks')[0],
threads = GmailApp.search('-in:Trash AND ('+
'from:[email protected]'+
' OR (to:[email protected] AND "You received a transfer of")'+
' OR (to:[email protected] AND "Your payment of")'+
' OR (to:[email protected] AND "CASH26 Withdraw")'+
' OR (to:[email protected] AND "Direct Debit collected")'+
' OR (to:[email protected] AND "Refund successful")'+
' OR (to:[email protected] AND "Transfer received")'+
@FirePanther
FirePanther / downloadYoutubeChannel.php
Last active November 17, 2016 04:00
download all youtube videos of channels
<?php
/**
* @author FirePanther (http://suat.be)
* @copyright DevMe (http://devme.de)
* @description youtube.php: Download all videos of channels
* @date 17/04/16
* @dependencies - youtube-dl (same location): https://yt-dl.org/downloads/2016.04.13/youtube-dl
* - brew: AtomicParsley, coreutils (gtouch, gecho)
*/
@FirePanther
FirePanther / permanentlyDelete.gs
Last active November 8, 2016 01:17
Permanenty delete some Google Drive files from the trash. After I've watched the Videos in my YouTube folder I remove them but they still take much space in my Google Drive.
/**
* Permanenty delete some Google Drive files from the trash.
*/
function run() {
var trashed = DriveApp.getTrashedFiles();
while (trashed.hasNext()) {
parseTrashedFile(trashed.next());
}
}
<?php
sd('./', parseFile);
/**
* recursive scandir
*/
function sd($d, $cb) {
$s = scandir($d);
foreach ($s as $f) {
if ($f[0] == '.') continue;
@FirePanther
FirePanther / autoFinderGitTag.sh
Last active November 19, 2016 17:23
Automatically adds a Finder "Git" Tag to all your repos
#!/bin/bash
# requires 'tag' binary from https://github.com/jdberry/tag
# auto git tag
{
find $HOME -type d \
! -path '*Trash' \
-name ".git" -exec dirname {} \; | while read line; do \
./tag -a Git "$line"; done
@FirePanther
FirePanther / suat.be-FinderTags.sh
Last active December 10, 2016 02:58
I recently moved to another Domain (from suat.be to su.at). This cron script automatically adds a "suat.be" Finder tag to all files which contains this string (so I can replace it with su.at)
# you will need https://github.com/jdberry/tag for finder tags (and correct the path)
{
grep -rlI --null "suat.be" --exclude-dir=".git" --exclude-dir="Library" --exclude-dir="Mail Attachments" --exclude-dir="Paperwork" --exclude="*.log" --exclude="*.eml" --exclude="minibackups.sh" "$HOME" | xargs -0 .../execs/tag -a "suat.be"
} &> /dev/null