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
@cleverdevil
cleverdevil / overcast-recently-played.py
Last active March 4, 2024 09:28
Fetch recently played episodes from Overcast.fm. Then, publish history to my website.
'''
You'll need to pip install some dependencies:
* python-dateutil
* requests
Also, populate your EMAIL and PASSWORD below.
'''
from xml.etree import ElementTree
@alexedwards
alexedwards / main.go
Created January 28, 2018 11:32
RequireLogin middleware
var sessionManager = scs.NewCookieManager("...")
func RequireLogin(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
session := sessionManager.Load(r)
userID, err := session.GetInt("userID")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
@devjin0617
devjin0617 / .manifest
Created May 19, 2017 15:15
chrome extension using a content script to access the `window` object
{
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["inject.js"],
"all_frames": true
}
],
"web_accessible_resources": [
"content.js"
ROM ruby:2.2.3
RUN apt-get update -qq && apt-get install -y build-essential
RUN apt-get install -y libpq-dev
RUN apt-get install -y ghostscript
RUN mkdir /app
WORKDIR /app
@ts95
ts95 / ScreenshotDetector.swift
Last active February 14, 2022 19:49
OS X detect new screenshot event with Swift
import Foundation
typealias NewFileCallback = (fileURL: NSURL) -> Void
class ScreenshotDetector: NSObject, NSMetadataQueryDelegate {
let query = NSMetadataQuery()
var newFileCallback: NewFileCallback?
@nderkach
nderkach / ios_github_gif.md
Last active February 15, 2024 23:31
How to record iOS screen and share it on github

Record a screencast with QuickTime Player

  1. Connect an iOS defice with a cable
  2. In QuickTime Player: Option-Cmd-N (New Movie Recording) -> Select your device from the recording menu:

http://cl.ly/image/1w0y3Y0H2g2X/record.png

Install gifify

@averagehuman
averagehuman / postgres-docker-config.sh
Last active April 3, 2019 22:36
Run postgres on docker host, connect from docker containers
#!/bin/bash
################################################################################
# Rather than run postgres in its own container, we want to run it on
# the (Ubuntu) host and allow:
#
# + peer connections on the host
# + local md5 connections from any docker container
#
# THIS IS COPY/PASTED FROM COMMAND LINE INPUT AND IS UNTESTED AS A SINGLE SCRIPT
################################################################################
@SimonSimCity
SimonSimCity / brew-update-notifier.sh
Last active November 5, 2023 09:30 — forked from stephennancekivell/brew-update-notifier.sh
Extended the script, written by @streeter to exclude the pinned formulae in the list of formulas to update.
#!/bin/bash
#
# Notify of Homebrew updates via Notification Center on Mac OS X
#
# Author: Chris Streeter http://www.chrisstreeter.com
# Requires: terminal-notifier. Install with:
# brew install terminal-notifier
TERM_APP='/Applications/Terminal.app'
BREW_EXEC='/usr/local/bin/brew'
@peta
peta / fm4-grabber.rb
Last active June 25, 2020 20:25
Die Jungs von ORF/FM4/APA haben offenbar den Publishingworkflow und die Integration der FM4oD Mitschnitte auf fm4.orf.at überarbeitet -- und somit mein altbewährtes Grabber-Bashskript unbrauchbar gemacht. Die neue Lösung ist etwas komplexer, weswegen ich das Skript auch mit Ruby anstatt Bash umgesetzt habe, aber funktioniert dennoch gewohnt zuve…
#!/usr/bin/env ruby
# encoding: UTF-8
require 'uri'
require 'open-uri'
require 'json'
require 'nokogiri'
class PodcastGrabber
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}