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 / 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)
*/
function parseBanks() {
var calendar = CalendarApp.getCalendarsByName('[a] Banks')[0],
threads = GmailApp.search('-in:Trash AND ('+
'from:infoservices@information.deutsche-bank.de'+
' OR (to:number26@suat.be AND "You received a transfer of")'+
' OR (to:number26@suat.be AND "Your payment of")'+
' OR (to:number26@suat.be AND "CASH26 Withdraw")'+
' OR (to:number26@suat.be AND "Direct Debit collected")'+
' OR (to:number26@suat.be AND "Refund successful")'+
' OR (to:number26@suat.be AND "Transfer received")'+
@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 = [];
@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
]
]
],
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 / 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:versandbestaetigung@amazon.de'),
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();
@FirePanther
FirePanther / parseYoutubemails.js
Last active November 17, 2016 04:10
Parses YouTube Mails, sende them to a Server to Download the videos
function myFunction() {
var labelName = "YouTube",
label = GmailApp.getUserLabelByName(labelName),
threads = label.getThreads(),
msg, match, date, now = new Date(), afterTime = 1000 * 60 * 60;
Logger.log("Threads: " + threads.length);
for (var x in threads) {
Logger.log("Found thread: " + threads[x].getFirstMessageSubject());
msg = threads[x].getMessages();
match = msg[0].getPlainBody().match(/watch\?v=(.*?)\&/);
public static boolean prim(int zahl) {
if (zahl == 2) return true;
else if (zahl == 1 || zahl % 2 == 0) return false;
else {
for(int i = 3; i <= Math.ceil(Math.sqrt(zahl)); i += 2) {
if (zahl % i == 0) return false;
}
return true;
}
}
@FirePanther
FirePanther / codaHideDotfilesException.regex
Last active November 17, 2016 03:45
Coda2: hide dot files on $HOME but show .bash_... files (don't show bash_sessions)
hide all files whose Path matches:
.*/Users/[^\/]+/(\.bash_sessions|\.((?!bash_).)*|npm\-debug\.log)
#!/bin/bash
i=0
for i in `seq 1 10`; do
starttime=`gdate +%s%3N`
start=`gdate +%s -r "$HOME/Library/Application Support/Alfred 2/Databases/clipboard.alfdb"`
echo `gdate +%s%3N` | pbcopy
until [ start != current ]; do
current=`gdate +%s -r "$HOME/Library/Application Support/Alfred 2/Databases/clipboard.alfdb"`
done
endtime=`gdate +%s%3N`