Skip to content

Instantly share code, notes, and snippets.

View kkebo's full-sized avatar
📱
Using iPad Pro 13” (M4)

Kenta Kubo kkebo

📱
Using iPad Pro 13” (M4)
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active May 18, 2024 17:55
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@rileytestut
rileytestut / ExportIPA.swift
Last active March 4, 2024 09:36
Export Swift Playgrounds .ipa
import Foundation
// Export running app as .ipa, then return path to exported file.
// Returns String because app crashes when returning URL from async function for some reason...
func exportIPA() async throws -> String
{
// Path to app bundle
let bundleURL = Bundle.main.bundleURL
// Create Payload/ directory
@voluntas
voluntas / open_momo.rst
Last active March 1, 2024 13:51
OpenMomo プロジェクト
@manasthakur
manasthakur / plugins.md
Last active May 2, 2024 05:48
Managing plugins in Vim

Managing plugins in Vim: The basics

Let's say the plugin is at a GitHub URL https://github.com/manasthakur/foo. First get the plugin by either cloning it (git clone https://github.com/manasthakur.foo.git) or simply downloading it as a zip (from its GitHub page).

Adding a plugin in Vim is equivalent to adding the plugin's code properly into its runtimepath (includes the $HOME/.vim directory by default). For example, if the layout of a plugin foo is as follows:

foo/autoload/foo.vim
foo/plugin/foo.vim
@robo8080
robo8080 / FaceDetectTest2.py
Created September 3, 2016 12:29
FaceDetectTest2.py
# coding: utf-8
import photos
import console
from objc_util import *
CIFilter, CIImage, CIContext, CIDetector, CIVector = map(ObjCClass, ['CIFilter', 'CIImage', 'CIContext', 'CIDetector', 'CIVector'])
def take_photo(filename='.temp.jpg'):
img = photos.capture_image()
@steventroughtonsmith
steventroughtonsmith / main.m
Created March 24, 2016 08:08
Load Mach-O executable at runtime and execute its entry point
void callEntryPointOfImage(char *path, int argc, char **argv)
{
void *handle;
int (*binary_main)(int binary_argc, char **binary_argv);
char *error;
int err = 0;
printf("Loading %s…\n", path);
handle = dlopen (path, RTLD_LAZY);
@voluntas
voluntas / realtime_movie_stream.rst
Last active May 18, 2023 04:25
リアルタイム動画配信コトハジメ
@omz
omz / Add Web Tab.py
Last active December 3, 2023 23:33 — forked from steventroughtonsmith/Add Web Tab.py
Insert a custom browser tab into Pythonista
# coding: utf-8
from objc_util import *
import console
import urllib
import dialogs
WKWebView = ObjCClass('WKWebView')
UIViewController = ObjCClass('UIViewController')
UIBarButtonItem = ObjCClass('UIBarButtonItem')
NSURLRequest = ObjCClass('NSURLRequest')
@geomaedr
geomaedr / gist:1926562ab9b051552a4c
Last active August 29, 2015 14:04 — forked from padolsey/gist:527683
JavaScript: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@akanehara
akanehara / scope.coffee
Last active August 29, 2015 14:04
var がないことによる問題
# var がないことによる問題
# 関数sum内の x がローカル変数であることをいつも保証できない
# このコメントアウトを外すと sum 内の x はローカル変数でなくなる
# x = 100
sum = (n) ->
x = 0
for i in [1..n]
x += i