Skip to content

Instantly share code, notes, and snippets.

View dewey's full-sized avatar
👋
Click here to edit status

Philipp Defner dewey

👋
Click here to edit status
View GitHub Profile
@dewey
dewey / main.go
Created February 20, 2023 17:50
Batch delete customers from Gambio Shop
package main
import (
"encoding/json"
"fmt"
"net/http"
"strconv"
"strings"
)
FROM ruby:2.7-alpine AS build-env
ARG RAILS_ROOT=/app
ARG BUILD_PACKAGES="build-base curl-dev git"
ARG DEV_PACKAGES="postgresql-dev yaml-dev zlib-dev nodejs yarn"
ARG RUBY_PACKAGES="tzdata"
ENV RAILS_ENV=production
ENV NODE_ENV=production
ENV BUNDLE_APP_CONFIG="$RAILS_ROOT/.bundle"
WORKDIR $RAILS_ROOT
@dewey
dewey / app.js
Created November 6, 2014 23:16
Script to calculate the total size of data listed in all torrent files in a given directory
// Script to calculate the total size of data listed in all torrent files in a given directory.
//
// Dependencies: Install `parse-torrent-file` and `glob` with `npm install`. `fs` is already a core library.
// Usage: Move all directories containing *.torrent files into the torrent/ directory
// and run `node app.js`.
//
// Author: https://github.com/dewey - 6.11.2014
var parseTorrentFile = require('parse-torrent-file'),
fs = require('fs'),
@dewey
dewey / lastfm.php
Created June 22, 2013 16:30
Last.fm "now playing" script for Textual. Installation: Replace 'apfeltalkdewey' with your Last.fm username. Copy this script to ~/Library/Application Scripts/com.codeux.irc.textual/lastfm.php Usage: /lastfm
#!/usr/bin/php
<?php
$doc = new DOMDocument();
$doc->load("http://ws.audioscrobbler.com/2.0/user/apfeltalkdewey/recenttracks.xml?limit=1");
$arrFeeds = array();
foreach ($doc->getElementsByTagName('track') as $node) {
$itemRSS = array (
'artist' => $node->getElementsByTagName('artist')->item(0)->nodeValue,
'name' => $node->getElementsByTagName('name')->item(0)->nodeValue
);
@dewey
dewey / cloudSettings
Created August 24, 2018 14:30
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-08-24T14:30:14.047Z","extensionVersion":"v3.0.0"}
@dewey
dewey / mail.md
Last active August 14, 2018 03:52
Gitlab Vulnerability Spam

Update: Seems to be real https://news.ycombinator.com/item?id=11587416

Original Message:

I received this message on Wednesday, April 27, 2016 7:35 PM. Couldn't find anything about it on Gitlab's Blog or Twitter so I asked for clarification here: https://twitter.com/tehwey/status/725612585886842880

Anyone else got one of these, maybe to an address that's exclusively used on Gitlab? There also seems to be a huge spam issue going on in their issue tracker right now:

https://gitlab.com/gitlab-org/gitlab-ce/issues?page=5&scope=all&sort=id_desc&state=opened

@dewey
dewey / gist:4c1c8cf7d289e5c3437b6bc6b92e8698
Created April 9, 2016 21:22
Kernel flags for Docker on Gentoo
* CONFIG_CGROUP_HUGETLB: is not set when it should be.
* CONFIG_NET_CLS_CGROUP: is not set when it should be.
* CONFIG_RT_GROUP_SCHED: is not set when it should be.
* CONFIG_CGROUP_NET_PRIO: is not set when it should be.
* CONFIG_DEVPTS_MULTIPLE_INSTANCES: is not set when it should be.
* CONFIG_CGROUP_DEVICE: is not set when it should be.
* CONFIG_CGROUP_FREEZER: is not set when it should be.
* CONFIG_CGROUP_SCHED: is not set when it should be.
* CONFIG_NF_NAT_IPV4: is not set when it should be.
@dewey
dewey / config
Last active January 3, 2016 22:09
~/.newsbeuter/config
# Refreshing
auto-reload yes
reload-threads 3
reload-time 20
feed-sort-order unreadarticlecount-asc
# Open links in this browser
browser open
# Write error log
@dewey
dewey / git-deploy.md
Created January 10, 2014 22:39
Deploy websites using git

The local repository

cd ~/sites
mkdir example.com
cd example.com
git init
> Initialized empty Git repository in /Users/dewey/sites/example.com/.git/

The remote repository

cd ~/Documents/Developement/Eclipse/Trash
cp -R code ~
git branch -D abgabe
git checkout --orphan abgabe
git rm -rf .
rm -rf documentation .DS_Store code
git rm -r --cached documentation speisekarten .settings README.md
mv ~/code .
git add code/
git commit -m "Commit: $(date)"