Skip to content

Instantly share code, notes, and snippets.

View pieterclaerhout's full-sized avatar

Pieter Claerhout pieterclaerhout

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UnifiedBar</key>
<dict>
<key>DisclosureRequired</key>
<string>ace440ac-b4f6-4b43-aade-02bba1589aef</string>
<key>Enabled</key>
<false/>
@OzanKurt
OzanKurt / arr_dot.js
Created December 8, 2020 00:51
Laravel's Arr::dot function for Javascript.
/**
* Laravel's Arr::dot function for Javascript.
* IMPORTANT: Requires lodash installed.
*/
function dot(array, prepend) {
results = []
prepend = prepend || ''
$.each(array, function(key, value) {
if ((_.isObject(value) || _.isArray(value)) && ! _.isEmpty(value)) {
@steipete
steipete / URLCacheTest.swift
Last active April 4, 2024 18:16
Using URLCache with download tasks (NSURLCache & NSURLSessionDownloadTask)
import Foundation
import os.log
class URLCacheTest {
let logger = Logger(subsystem: "URLCacheTest", category: "main")
// HTTP HEADERS:
// Date: Wed, 04 Nov 2020 11:13:24 GMT
// Server: Apache
// Strict-Transport-Security: max-age=63072000; includeSubdomains; preload
@ziadoz
ziadoz / Caddyfile
Created July 5, 2020 18:04
Laravel Caddy v2 Caddyfile
example.com {
root * /var/www/vhosts/example.com/public
php_fastcgi unix//var/run/php/php7.4-fpm.sock
file_server
encode zstd gzip
}
@ndaidong
ndaidong / install-go.sh
Last active June 1, 2021 21:34
Install Go on Endeavour, Debian, Fedora
#!/bin/bash
export GO_VERSION=1.16.3
export GO_DOWNLOAD_URL=https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz
export GOROOT=/opt/go
export GOPATH=$GOROOT/packages
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
sudo mkdir $GOROOT
@Inferis
Inferis / ViewController.swift
Last active December 1, 2019 23:27
Beginnings of a GCD wrapper in swift
import UIKit
import QuartzCore
class ViewController: UIViewController {
@IBOutlet weak var label: UILabel
@IBOutlet weak var counter: UILabel
override func viewDidLoad() {
super.viewDidLoad()
@davisford
davisford / setup-avahi.sh
Created July 12, 2013 14:14
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
@justincase
justincase / gist:5469009
Created April 26, 2013 17:45
Print struct with field names and values. From http://blog.golang.org/2011/09/laws-of-reflection.html
type T struct {
A int
B string
}
t := T{23, "skidoo"}
s := reflect.ValueOf(&t).Elem()
typeOfT := s.Type()
for i := 0; i < s.NumField(); i++ {
@jonah-williams
jonah-williams / build.sh
Created April 30, 2011 17:46
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
#!/usr/bin/env python
import sys, subprocess, re
RX_SUITE_START = re.compile(r"Test Suite '(?P<suitename>\w+)' started at (?P<date>[\d\-]+) (?P<time>[\d\:]+) (?P<tz>[\d\-\+]+)")
RX_SUITE_END = re.compile(r"Test Suite '(?P<suitename>\w+)' finished at (?P<date>[\d\-]+) (?P<time>[\d\:]+) (?P<tz>[\d\-\+]+)")
RX_TEST_START = re.compile(r"Test Case '(?P<testname>[^']+)' started\.")
RX_TEST_END = re.compile(r"Test Case '(?P<testname>[^']+)' passed \((?P<sec>[\d\.]+) seconds\)\.")
RX_TEST_FAIL = re.compile(r"Test Case '(?P<testname>[^']+)' failed \((?P<sec>[\d\.]+) seconds\)\.")