Skip to content

Instantly share code, notes, and snippets.

View yxjxx's full-sized avatar
🎯
Focusing

Jing Yang yxjxx

🎯
Focusing
View GitHub Profile
@BandarHL
BandarHL / FixTwitterKeychain.m
Created August 15, 2020 18:05
Fix Twitter Login for non-JB (IPA)
%hook TFSKeychain
- (NSString *)providerDefaultAccessGroup {
NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:
(__bridge NSString *)kSecClassGenericPassword, (__bridge NSString *)kSecClass,
@"bundleSeedID", kSecAttrAccount,
@"", kSecAttrService,
(id)kCFBooleanTrue, kSecReturnAttributes,
nil];
CFDictionaryRef result = nil;
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);
@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active April 26, 2024 10:15
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@int64ago
int64ago / daily_vnet.py
Last active May 18, 2021 07:26
微林【每日礼包】自动签到脚本
#!/usr/bin/python2
# -*- coding: utf-8 -*-
#
# This's an auto-sign script for vnet.link
# You should install PIL first, for Ubuntu 14.04:
# sudo apt-get build-dep python-imaging python-pip -y && pip install Pillow
#
# 12/3/2016 Cody Chan <int64ago@gmail.com>
# To support me, register from https://vnet.link/?rc=36900
@tiann
tiann / alfred-pinyin.py
Last active April 5, 2024 14:59
make alfred support pinyin search
#! /usr/bin/python
# -*- coding: utf-8 -*-
# @author weishu @2015/12/7
import subprocess
import os
import re
import json
@mackuba
mackuba / wwdc15.md
Last active August 6, 2022 17:28
New stuff from WWDC 2015

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
@mwender
mwender / impbcopy.m
Last active April 29, 2024 02:40
Command line copy an image file to the clipboard in Mac OS X. See first comment for install instructions.
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
BOOL copy_to_clipboard(NSString *path)
{
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage
NSImage * image;
if([path isEqualToString:@"-"])
{
// http://caiustheory.com/read-standard-input-using-objective-c
@arudmin
arudmin / keepassx-to-1passwords.py
Last active November 14, 2019 19:01
Convert exported XML file from KeepassX that could be imported to 1Password (via CSV comma separated file)
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
from lxml import etree
import StringIO
import sys
reload(sys)
@P233
P233 / ios7-theme-for-v2ex
Last active December 9, 2016 07:51
体积稍大,需要压缩: http://cssminifier.com/
a:link, a:visited, a:active {
color: #8e8d93;
-webkit-transition: all .15s;
-moz-transition: all .15s;
-ms-transition: all .15s;
-o-transition: all .15s;
transition: all .15s;
}
a.top:link, a.top:visited, a.top:active {
color: #000;
@pbanaszkiewicz
pbanaszkiewicz / Preferences.sublime-settings
Last active December 27, 2021 16:53
Sublime Text 3 configuration
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_style": "solid",
"color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme",
"draw_minimap_border": true,
"enable_telemetry": false,
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
@fpfeng
fpfeng / v2ex_auto_login.py
Last active June 10, 2023 16:54
登录 V2EX 领取每日奖励
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
username = '' ###账号###
password = '' ###密码###
login_url = 'http://v2ex.com/signin' ###如V2EX设置了使用 SSL,必须改 https###
index_url = 'http://v2ex.com' ###同上###
mission_url = 'http://www.v2ex.com/mission/daily' ###同上###
UA = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) \