This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)deleteAllRecordings { | |
int count = 0; | |
NSFileManager *fileManager = NSFileManager.defaultManager; | |
NSURL *appSupport = | |
[fileManager URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask][0]; | |
NSURL *megacoolAppSupport = [appSupport URLByAppendingPathComponent:@"Megacool" isDirectory:YES]; | |
NSError *error; | |
NSArray<NSURL *> *recordingDirectories = [fileManager | |
contentsOfDirectoryAtURL:megacoolAppSupport | |
includingPropertiesForKeys:nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creates a self-signed certificate for a given domain name | |
set -e | |
if [ $# -ne 1 ]; then | |
echo "Usage: generate_cert.sh <domain-name>" | |
echo | |
echo "Generates a self-signed certificate for a given domain name." | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make this executable and name it .git/hooks/pre-commit to have commits | |
# randomly rejected with a prompt to rethink it. The odds are higher for | |
# longer commits | |
set -eu | |
# How many lines a commit must have before it's considered long and should | |
# have the highest odds of getting an extra prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import csv | |
import os | |
import time | |
import sys | |
import traceback | |
import datetime | |
from collections import OrderedDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
import os | |
import re | |
import requests | |
def main(): | |
to_read = 'yes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install and get hash in one step | |
# | |
# Downloads the packages to a temporary directory, gets the hash of the | |
# package and all dependencies, extracts the package names and prints | |
# a requirements.txt compatible string with the hash | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# This script is designed to sync mutt aliases with Google contacts | |
from __future__ import unicode_literals | |
import sys | |
import datetime | |
import atom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4; encoding:utf-8 -*- | |
# | |
# Copyright 2014 Håvard Gulldahl | |
# | |
# in part based on dpbxbackend.py: | |
# Copyright 2013 jno <[email protected]> | |
# | |
# This file is part of duplicity. | |
# | |
# Duplicity is free software; you can redistribute it and/or modify it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Count percentage of mail in IMAP inbox delivered over TLS, based on | |
presence of ESMTPS header. | |
""" | |
from collections import defaultdict | |
from contextlib import contextmanager | |
from email.parser import HeaderParser | |
from itertools import chain, islice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Hike map</title> | |
<style> | |
html, body, #map { | |
height: 100%; | |
} | |
</style> | |
<script src="http://www.openlayers.org/api/OpenLayers.js"></script> |
NewerOlder