Skip to content

Instantly share code, notes, and snippets.

View camflan's full-sized avatar

Camron Flanders camflan

View GitHub Profile
@fnky
fnky / ANSI.md
Last active May 19, 2024 14:13
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@soffes
soffes / SpaceView-iOS.swift
Last active June 29, 2017 19:11
Handy utility view when working with UIStackView
import UIKit
/// Space view intented to be used with auto layout.
/// Similar to UIStackView, setting a background color is not supported.
final class SpaceView: UIView {
// MARK: - Properties
private let contentSize: CGSize
public protocol TableViewCellFactoryType {
typealias DataItem
typealias Cell: UITableViewCell
func cellForItem(item: DataItem, inTableView tableView: UITableView, atIndexPath indexPath: NSIndexPath) -> Cell
func configureCell(cell: Cell, forItem item: DataItem, inTableView tableView: UITableView, atIndexPath indexPath: NSIndexPath) -> Cell
}
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@marcoarment
marcoarment / parallelize.c
Last active October 31, 2022 19:34
A simple shell command parallelizer.
/* parallelize: reads commands from stdin and executes them in parallel.
The sole argument is the number of simultaneous processes (optional) to
run. If omitted, the number of logical CPUs available will be used.
Build: gcc -pthread parallelize.c -o parallelize
Demo: (for i in {1..10}; do echo "echo $i ; sleep 5" ; done ) | ./parallelize
By Marco Arment, released into the public domain with no guarantees.
@lamprosg
lamprosg / appDelegate.mm
Last active February 11, 2023 08:55
(iOS) Running location updates in the background
-(void) applicationDidEnterBackground:(UIApplication *) application
{
// You will also want to check if the user would like background location
// tracking and check that you are on a device that supports this feature.
// Also you will want to see if location services are enabled at all.
// All this code is stripped back to the bare bones to show the structure
// of what is needed.
[locationManager startMonitoringSignificantLocationChanges];
@robinsloan
robinsloan / langoliers.rb
Last active April 7, 2024 13:22
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"