Skip to content

Instantly share code, notes, and snippets.

@remixnine
remixnine / colorlogcat.py
Created July 24, 2012 19:20 — forked from loopj/colorlogcat.py
Script to highlight Android's adb logcat output for console
#!/usr/bin/python
'''
Copyright 2009, The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@robhoare
robhoare / map.geojson
Created August 10, 2013 05:25
Canada census 1921, Toronto Centre: Sub-District 48 - Ward 3 Polling Subdivision no. 80. Comprising Charles Street, both sides, from Church to Jarvis Street; Hayden Street, both sides, from Church Street to east end; Bloor Street, south side, from Church toJrvis Street; Church Street, both sides, from Isabella to Bloor Street, Jarvis Street, wes…
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@algal
algal / NSDate+RFC3339.swift
Last active January 11, 2019 21:28
NSDate+RFC3339
// known-good: Xcode 7.3 (Swift 2.2)
import Cocoa
private var rfc3339formatter:NSDateFormatter = {
let formatter = NSDateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z"
formatter.timeZone = NSTimeZone(forSecondsFromGMT: 0)
formatter.calendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierISO8601)!
formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX")
@ricardopereira
ricardopereira / GradientLayer + Mask + TableView.swift
Last active July 19, 2023 16:59
Apply vertical mask alpha gradient to UITableView
let gradient = CAGradientLayer()
gradient.frame = tableView.superview?.bounds ?? CGRectNull
gradient.colors = [UIColor.clearColor().CGColor, UIColor.clearColor().CGColor, UIColor.blackColor().CGColor, UIColor.blackColor().CGColor, UIColor.clearColor().CGColor, UIColor.clearColor().CGColor]
gradient.locations = [0.0, 0.15, 0.25, 0.75, 0.85, 1.0]
tableView.superview?.layer.mask = gradient
tableView.backgroundColor = UIColor.clearColor()
@roberthein
roberthein / xyz_exporter.ms
Created December 21, 2016 10:45
An exporter for 3DsMax that exports a 3D scene to a .xyz format.
--maxscript by Robert-Hein Hooijmans, 2004
rollout scene_export "Scene to XYZ"
(
group "Animation Range:"
(
spinner anim_start "From:" fieldwidth:45 range:[animationrange.start,animationrange.end,0] type:#integer across:2
spinner anim_end "To:" fieldwidth:45 range:[1,animationrange.end,animationrange.end] type:#integer
spinner anim_step "Step:" fieldwidth:45 range:[1,100,1] type:#integer across:2
button btn_upd "Update" width:70 height:20 align:#right offset:[0,-2]
@inamiy
inamiy / SwiftElmFrameworkList.md
Last active March 11, 2024 10:20
React & Elm inspired frameworks in Swift
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

#
# uncrustify config file for objective-c and objective-c++
#
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
output_tab_size = 4 # new tab size
indent_columns = output_tab_size
indent_label = 2 # pos: absolute col, neg: relative column
indent_align_assign = FALSE