Skip to content

Instantly share code, notes, and snippets.

@pkazmierczak
pkazmierczak / async-python.py
Last active November 23, 2022 09:49
asyncio example (python3 & python2)
import asyncio
@asyncio.coroutine
def factorial(name, number):
f = 1
for i in range(2, number + 1):
print("Task %s: Compute factorial(%d)..." % (name, i))
yield from asyncio.sleep(1)
f *= i
@tzmartin
tzmartin / ios.settings.schemes.md
Created January 13, 2016 18:27
iOS Settings URL Scheme List

Settings URL schemes:

Note: < i=OS 5.1 use prefs:. > 5.1 use app-settings:

  • app-settings:root=General&path=About
  • app-settings:root=General&path=ACCESSIBILITY
  • app-settings:root=AIRPLANE_MODE
  • app-settings:root=General&path=AUTOLOCK
  • app-settings:root=General&path=USAGE/CELLULAR_USAGE
  • app-settings:root=Brightness
@evantoli
evantoli / GitConfigHttpProxy.md
Last active April 8, 2025 18:31
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@claymcleod
claymcleod / pycurses.py
Last active March 23, 2025 17:37
Python curses example
import sys,os
import curses
def draw_menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Clear and refresh the screen for a blank canvas
stdscr.clear()
@tangqiaoboy
tangqiaoboy / iOS 技能图谱.md
Last active February 10, 2024 12:43
iOS 技能图谱

编程语言

  • Swift
  • Objective-C
  • C++/C
  • JavaScript

操作系统

  • Mac OSX
  • iOS
@leichunfeng
leichunfeng / NSNull+LCFMessageForwarding.h
Last active April 6, 2016 04:58
通过重写 NSNull 的消息转发方法,来避免给 [NSNull null] 发消息时的闪退问题
//
// NSNull+LCFMessageForwarding.h
// NSNull
//
// Created by leichunfeng on 15/12/22.
// Copyright © 2015年 leichunfeng. All rights reserved.
//
#import <Foundation/Foundation.h>
@phpisciuneri
phpisciuneri / buildtools.sh
Created November 10, 2015 01:02
Install autoconf and automake Mac OS X
##
# Install latest autoconf and automake-1.15 on Mac OS X
# - Check for the latest version of automake at: http://ftpmirror.gnu.org/automake
#
# Usage:
# - Source this script: $ . buildtools.sh
#
# This script was adapted from:
# - https://gist.github.com/jellybeansoup/4192307
# - http://superuser.com/questions/383580/how-to-install-autoconf-automake-and-related-tools-on-mac-os-x-from-source (JakeGould answer)
@v1m
v1m / .curlrc
Last active January 30, 2025 09:32
sample .curlrc file
# this is a sample .curlrc file
# https://everything.curl.dev/ is a GREAT RESOURCE
# store the trace in curl_trace.txt file. beware that multiple executions of the curl command will overwrite this file
--trace curl_trace.txt
# store the header info in curl_headers.txt file. beware that multiple executions of the curl command will overwrite this file
--dump-header curl_headers.txt
#change the below referrer URL or comment it out entirely
@jason5ng32
jason5ng32 / surge.conf
Last active November 6, 2024 06:39
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = [email protected]:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
@FredCox3
FredCox3 / cfgutil help exec
Created October 9, 2015 11:15
cfgutil man page
cfgutil help exec
exec
Usage: exec [-a <path to attach script>] [-d <path to detach script>]
Run a script when devices attach or detach.
These environment variables will be set:
- ECID: Target device's ECID.
- PATH: The path will be changed to include cfgutil.