Skip to content

Instantly share code, notes, and snippets.

View tuoxie007's full-sized avatar

Jason Hsu tuoxie007

View GitHub Profile
@dsabanin
dsabanin / enable-xcode-debug-menu.sh
Last active November 7, 2022 16:17
Enable internal Xcode debug menu in Xcode 11
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
sudo mkdir -p /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode
sudo touch /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode/AppleInternal.plist
# Don't forget to restart Xcode
@denyago
denyago / README.md
Last active April 12, 2021 11:52
Screencast from Android

Screancasting from Android

There are 2 ways to capture video streams, but both have the same source adb shell screenrecord.

Important: device must be POWERFULL!

This will use "Raw frames". It can wait for user to continue

adb shell screenrecord --size=360x640 --output-format=raw-frames - | mplayer -demuxer rawvideo -rawvideo w=360:h=640:format=rgb24 -
@loderunner
loderunner / osx-ld.md
Last active July 7, 2024 00:47
potential blog posts

ld – Wading through Mac OS X linker hell

Intro

Friend: I tried looking at static linking in Mac OS X and it seems nearly impossible. Take a look at this http://stackoverflow.com/a/3801032

Me: I have no idea what that -static flag does, but I'm pretty sure that's not how you link to a library. Let me RTFM a bit.

Minutes later...

@jiaaro
jiaaro / _INSTRUCTIONS.md
Last active January 22, 2024 17:47
Using Swift libraries in Python

Using Swift libraries in Python

So... this is obviously totally, 100%, like for. real. not. supported. by. Apple. …yet?

But still... I thought it was pretty badass. And, seeing how there's already a Swift buildpack for Heroku you could move some slow code into Swift can call it as a library function. But, you know, not in production or anything. That would be silly, right?

Now, having said that, the actual Python/Swift interop may have bugs. I'll leave that as an exercise to the reader.

How to get Python code calling Swift functions:

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@c0ming
c0ming / build.sh
Last active January 30, 2019 01:12
A script for build iOS7 universal static library with clang
#!/bin/bash
# e.g. libmms http://sourceforge.net/projects/libmms/
# set -x
BUILD_DIR=`pwd`"/build"
STATIC_LIB_NAME="libmms.a"
STATIC_LIB_NAME_ARM="libmms.a.arm"
STATIC_LIB_NAME_X86="libmms.a.x86"
@visnup
visnup / SlideAnimatedTransitioning.h
Last active November 13, 2023 12:07
iOS 7 screen edge gesture swipe from right to left (similar to edge swiping from left to right) on UINavigationController. *only* the edge swipe uses the custom transition; everything else uses default behaviors.
//
// SlideAnimatedTransitioning.h
// SwipeLeft
//
// Created by Visnu on 4/14/14.
// Copyright (c) 2014 Visnu Pitiyanuvath. All rights reserved.
//
#import <Foundation/Foundation.h>
@ajamaica
ajamaica / gist:5893344
Created June 30, 2013 01:03
UIInterpolatingMotionEffect
UIInterpolatingMotionEffect *mx = [[UIInterpolatingMotionEffect alloc]
initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
mx.maximumRelativeValue = @-39.0;
mx.minimumRelativeValue = @39.0;
UIInterpolatingMotionEffect *mx2 = [[UIInterpolatingMotionEffect alloc]
initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
mx2.maximumRelativeValue = @-39.0;
mx2.minimumRelativeValue = @39.0;
@xurenlu
xurenlu / iconv-gbkencode.js
Created June 13, 2013 03:47
nodejs-gbkUrlencode.js
function encodeURIComponentUTF8toGBK(utf8String){
var Iconv = require("iconv").Iconv;
var iconvLite=require("iconv-lite");
var Buffer =require("buffer").Buffer;
var iconv = new Iconv("UTF-8","GBK");
var res = iconv.convert(utf8String);
return encodeURIComponent(iconvLite.decode(res,"GBK"));
}
console.log(
@kvnsmth
kvnsmth / example-subtree-usage.md
Last active March 5, 2023 21:58
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add git@github.com:AFNetworking/AFNetworking.git Vendor/AFNetworking

or something to that effect.