Skip to content

Instantly share code, notes, and snippets.

View lukaskollmer's full-sized avatar
🧚‍♂️
frolicking

Lukas Kollmer lukaskollmer

🧚‍♂️
frolicking
View GitHub Profile
"""
Use custom fonts in the editor
Usage: https://forum.omz-software.com/topic/3419/share-code-custom-editor-font
"""
__author__ = "Lukas Kollmer<lukas.kollmer@gmail.com>"
__copyright__ = "Copyright (c) 2016 Lukas Kollmer<lukas.kollmer@gmail.com>"
from objc_util import *
@lukaskollmer
lukaskollmer / pythonista_view_hierarchy.txt
Created August 14, 2016 14:48
Output of `[UIViewController _printHierarchy]` and `[UIWindow recursiveDescription]`
***** [UIViewController _printHierarchy] *****
<PASlidingContainerViewController 0x127ebcdc0>, state: appeared, view: <UIView 0x127f4d4a0>
| <UINavigationController 0x12805be00>, state: appeared, view: <UILayoutContainerView 0x127e51fe0>
| | <PA2ScriptLibraryViewController 0x127e4efd0>, state: appeared, view: <UITableView 0x12807ee00>
| <PA2TabViewController 0x128027a00>, state: appeared, view: <UIView 0x127ec1cf0>
| | <PA2UniversalTextEditorViewController 0x12905ead0>, state: appeared, view: <UIView 0x129523260>
| <PA2AccessoryTabViewController 0x12894dc00>, state: appeared, view: <UIView 0x127d36120>
| | <PA2ConsoleViewController 0x127dbad90>, state: appeared, view: <UIView 0x127e5d990>
{
BuildMachineOSBuild = 15F34;
CFBundleDevelopmentRegion = en;
CFBundleDocumentTypes = (
{
CFBundleTypeExtensions = (
sln
);
CFBundleTypeName = "Continuous Solution";
CFBundleTypeRole = Editor;
<Upsight_iOS_WorkspaceNavigationController 0x14ee9b400>, state: appeared, view: <UILayoutContainerView 0x14f092240>
| <Upsight_iOS_WorkspaceController 0x14f01c0a0>, state: appeared, view: <UIView 0x14f18a1a0>
| | <Upsight_iOS_SplitterViewController 0x14f241330>, state: appeared, view: <UIView 0x14f2422d0>
| | <Upsight_iOS_TabViewController 0x14f302770>, state: appeared, view: <UIView 0x14f24ac70>
| | <Upsight_iOS_TabViewController 0x14f308730>, state: appeared, view: <UIView 0x14f309b10>
| | <Upsight_iOS_TabViewController 0x14f0e2080>, state: appeared, view: <UIView 0x14f0e0800>
| | <Upsight_iOS_UIKitHelpers_WorkspaceNavigationController 0x14e695600>, state: disappeared, view: <UILayoutContainerView 0x14f251870>
| | | <Upsight_iOS_BrowseWorkspaceNodeController 0x14f24ef20>, state: disappeared, view: <UITableView 0x14fa36a00>
| | <Upsight_iOS_UIKitHelpers_WorkspaceNavigationController 0x14e54cc00>, state: appeared, view: <UILayoutContainerView 0x14f25f630>
|
@lukaskollmer
lukaskollmer / nginxproxy.md
Created September 11, 2016 14:59 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@lukaskollmer
lukaskollmer / ios-bundles.m
Created October 16, 2016 11:20
CFBundleGetAllBundles
CFArrayRef allBundles = CFBundleGetAllBundles();
CFIndex count = CFArrayGetCount(allBundles);
for (int i = 0; i < count; i++) {
CFBundleRef bundle = (CFBundleRef)CFArrayGetValueAtIndex(allBundles, i);
NSLog(@"%@ %@", CFBundleGetIdentifier(bundle), bundle);
}
2016-10-16 13:18:35.501470 Scripter[10292:5364858] me.kollmer.Scripter CFBundle 0x11dd00b90 </var/containers/Bundle/Application/A25154D4-4622-4C87-AEF6-05AEB04F3942/Scripter.app> (executable, loaded)
2016-10-16 13:18:35.501787 Scripter[10292:5364858] com.apple.UIKit CFBundle 0x11dd0ce70 </System/Library/Frameworks/UIKit.framework> (framework, loaded)
2016-10-16 13:18:35.501933 Scripter[10292:5364858] com.apple.DTDDISupport CFBundle 0x11df11310 </Developer/Library/PrivateFrameworks/DTDDISupport.framework> (framework, loaded)
@lukaskollmer
lukaskollmer / yyyyyyy.html
Created October 16, 2016 21:46
yyyyyyy.info
<html><head>
<meta charset="utf-8">
<meta http-equiv="X-Frame-Options" content="deny">
<title>▅▆▇▆▅▄▃ `^^^^^~ ░ ui▀┳╲ ☺ .info ▓</title>
<meta name="Keywords" content="keywords, keys, words, wordkeys">
<link rel="shortcut icon" href="favicon.ico">
<link href="assets/layout.css" rel="stylesheet" type="text/css">
<link href="assets/styles.php" rel="stylesheet" type="text/css">
<script type="text/javascript" async="" defer="" src="//piwik.michaelguidetti.info/piwik.js"></script><script type="text/javascript" src="assets/scripts.js"></script>
</head>
@lukaskollmer
lukaskollmer / battery.js
Last active June 30, 2017 08:04
Check the battery level
const {UIDevice} = require("objc");
const currentDevice = UIDevice.currentDevice();
const batteryStates = ["Unknown", "Unplugged", "Charging", "Full"];
// Start battery monitoring
currentDevice.setBatteryMonitoringEnabled_(true);
const level = currentDevice.batteryLevel();
const state = currentDevice.batteryState();
@lukaskollmer
lukaskollmer / liveClock.swift
Last active December 19, 2016 15:22
Swift live clock demo
//
// ViewController.swift
// DemoTimer
//
// Created by Lukas Kollmer on 19/12/2016.
// Copyright © 2016 Lukas Kollmer. All rights reserved.
//
import UIKit
@lukaskollmer
lukaskollmer / tableview.js
Last active December 26, 2016 20:27
Example of ui.TableView in the Scripter app
const ui = require("ui");
class MyTableView extends ui.TableView {
constructor() {
super("grouped");
this.title = "Choose your Doctor";
this.names = [
"Christopher Eccleston",
"David Tennant",
"Matt Smith",