Skip to content

Instantly share code, notes, and snippets.

View quinncnl's full-sized avatar

Quinn quinncnl

  • Eindhoven
  • 10:35 (UTC +01:00)
View GitHub Profile
@quinncnl
quinncnl / vsftpd.conf
Created February 20, 2013 03:14 — forked from stas/vsftpd.conf
###
# VSFTPD.CONF for virtual users with write/read/delete permissions
###
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
@quinncnl
quinncnl / network
Last active December 18, 2015 18:59
interface=eth0
address=192.168.0.8
netmask=24
broadcast=192.168.0.255
gateway=192.168.0.1
@quinncnl
quinncnl / getip.py
Last active December 18, 2015 20:49
#!/usr/bin/env python3
import json, sys, socket
import urllib.request
try:
socket.inet_aton(sys.argv[1])
ip=sys.argv[1]
except socket.error:
#!/usr/bin/env python
import urllib.request
import re, time, os
def getIP():
try:
with urllib.request.urlopen('http://myip.com.tw/') as f:
a = f.read().decode('utf-8')
except:
ls > list
sed -e "s/^/omnivore.gpx\('velo\/201409\//" list >> list
sed -e "s/$/').addTo(map);/" list >> list
//
// Geohash.swift
// mn_ios
//
// Created by Alex Bosworth on 11/26/14.
// Copyright (c) 2014 adylitica. All rights reserved.
//
import Foundation
import MapKit
@quinncnl
quinncnl / gist:4765db56b5db4729c3d5
Last active August 29, 2015 14:27 — forked from rgcottrell/gist:fdc7dd7cf5bc3ed61010
Thread safe shared instance "singletons" in Swift.
class Singleton {
class var sharedInstance: Singleton {
struct Static {
static var token: dispatch_once_t = 0
static var instance: Singleton!
}
dispatch_once(&Static.token) {
Static.instance = Singleton()
}
return Static.instance
// https://on4wp7.codeplex.com/SourceControl/changeset/view/21483#353936
//
// Copyright (C) 1000 - 9999 Somebody Anonymous
// NO WARRANTY OR GUARANTEE
//
using System;
namespace Navi
@quinncnl
quinncnl / UIScrollViewScrolling.swift
Last active April 9, 2020 09:08
How to detect when a UIScrollView has finished scrolling
// http://stackoverflow.com/questions/993280/how-to-detect-when-a-uiscrollview-has-finished-scrolling
func scrollViewDidScroll(scrollView: UIScrollView) {
performSelector(#selector(UIScrollViewDelegate.scrollViewDidEndScrollingAnimation(_:)), withObject: nil, afterDelay: 0.3)
}
func scrollViewDidEndScrollingAnimation(scrollView: UIScrollView) {
print("scrollViewDidEndDecelerating")
NSObject.cancelPreviousPerformRequestsWithTarget(self)
@quinncnl
quinncnl / TBBT.S08E21
Last active May 12, 2016 04:50
Series 8 Episode 21 – The Communication Deterioration
Scene: The cafeteria.
Sheldon: Hey, would you like to hear some songs I’ve rewritten to get children interested in the hard sciences?
Howard: Sure.
Leonard: Really?
Howard: Yeah. Well, I like music, I like science, I like making fun of Sheldon. Hit it.