Skip to content

Instantly share code, notes, and snippets.

View JesperDramsch's full-sized avatar
🤓
This mind is intentionally left blank.

Jesper Dramsch JesperDramsch

🤓
This mind is intentionally left blank.
View GitHub Profile
@JesperDramsch
JesperDramsch / SEG-Y EBCDIC Header Extraction
Created September 10, 2013 21:49
This line of code extracts the EBCDIC header of SEG-Y data and makes it human readable in ASCII encoding.
dd bs=3200 count=1 conv=ascii if=data.segy | sed 's/.\{80\}/&\n/g' | sed 's/^.\{3\}/& /g' > header.txt
@JesperDramsch
JesperDramsch / markdown_to_bbcode.py
Last active December 22, 2015 18:59 — forked from masukomi/markdown_to_bbcode.py
Included File Operation
import re
def markdown_to_bbcode(s):
links = {}
codes = []
def gather_link(m):
links[m.group(1)]=m.group(2); return ""
def replace_link(m):
return "[url=%s]%s[/url]" % (links[m.group(2) or m.group(1)], m.group(1))
def gather_code(m):
@JesperDramsch
JesperDramsch / PromaxFlowMove.sh
Last active December 23, 2015 10:49
This moves the "Print Flow" Output of Promax to a predefined Output Path
#! /bin/bash
#
# Define environment
Machine='[Machine Name]'
User='[User Name]'
PromaxData='/Promax/ProMAX/data/[Project Name]/[Line Name]'
OutData="[Output Path]"
# Read number Code of flow. I usually introduce initial numbers for my workflows.
@JesperDramsch
JesperDramsch / Docs_Temp_Import
Created August 23, 2014 12:26
Google Docs Temperature of Tomorrow
=ImportXML("http://api.openweathermap.org/data/2.5/forecast/daily?q=Hamburg,de&mode=xml&units=metric&cnt=2";"//time[last()]/temperature/@day")
@JesperDramsch
JesperDramsch / .htaccess
Last active August 29, 2015 14:26
Block Semalt / Referral Spam on Websites
# MODIFIED FROM PERISHABLE PRESS ULTIMATE REFERRER BLACKLIST
# https://perishablepress.com/4g-ultimate-referrer-blacklist/
# This is a modified referrer blacklist from http://brassblogs.com/blog/htaccess-and-spam by JesperDramsch
# This blacklist is ready to use in your site's root htaccess file
# Edit the first two lines with your specific domain information
# Check http://brassblogs.com/blog/htaccess-and-spam for updates and include my additions
# Analytics Spam Blocker - Start
<IfModule mod_rewrite.c>
@JesperDramsch
JesperDramsch / keras.telegram_callback.py
Created March 27, 2018 07:40
Small script to add keras push notifications to Telegram.
import telegram_send
telegram_send.configure('~/.telegram/.conf')
class TelegramCallback(keras.callbacks.Callback):
def on_train_begin(self, logs={}):
telegram_send.send(["Starting Training"])
def on_train_end(self, logs={}):
telegram_send.send(["Training Finished"])
def on_batch_end(self, batch, logs={}):
telegram_send.send(["Loss: {:.8f} | Metrics: {:.5f}".format(logs.get('loss'),logs.get('acc'))])
@JesperDramsch
JesperDramsch / expat_keplergl.json
Last active February 24, 2020 16:27
KeplerGL Experiment with country rank by year for expats
{
"datasets": [
{
"version": "v1",
"data": {
"id": "vvzpce4kr",
"label": "Top Expat Destinations.csv",
"color": [
143,
47,
@JesperDramsch
JesperDramsch / MakeMediumReadadableUserscript.user.js
Created August 4, 2020 16:02 — forked from luke3butler/MakeMediumReadadableUserscript.user.js
Userscript version of the MMRA (Make Medium Readable Again) Chrome extension
// ==UserScript==
// @name Make Medium Readable Userscript
// @namespace http://make.medium.readable.again
// @version 0.1
// @description https://github.com/thebaer/MMRA
// @author luke3butler (Credits to Matt Baer)
// @match *://*/*
// @grant none
// ==/UserScript==
@JesperDramsch
JesperDramsch / news-feeds-eradicator-linkedin.user.js
Last active February 17, 2024 14:31 — forked from miglen/news-feeds-eradicator-linkedin.user.js
News Feed Eradicator for LinkedIn
// ==UserScript==
// @name News Feed Eradicator for LinkedIn
// @namespace http://miglen.com/
// @version 0.5
// @description News Feed Eradicator for LinkedIn
// @author Miglen Evlogiev (hi@miglen.com)
// @match https://www.linkedin.com/feed/
// @grant none
// @downloadURL https://gist.github.com/JesperDramsch/839365c85133927f694bf5113c77a2f1/raw/news-feeds-eradicator-linkedin.user.js
// @updateURL https://gist.github.com/JesperDramsch/839365c85133927f694bf5113c77a2f1/raw/news-feeds-eradicator-linkedin.user.js
@JesperDramsch
JesperDramsch / Update_Filters.gs
Last active October 23, 2021 23:45
Automatically Update GMail Filter When Assigning Label
function Intialize() {
return;
}
function Install() {
ScriptApp.newTrigger("updateFilter")
.timeBased().everyMinutes(10).create();
}