Skip to content

Instantly share code, notes, and snippets.

@LavareX
LavareX / GetCurrentLaunchImage.m
Last active January 4, 2018 09:37
Get current launch image programmatically
// Objective-C
- (UIImage *)getCurrentLaunchImage {
CGSize screenSize = [UIScreen mainScreen].bounds.size;
NSString *interfaceOrientation = nil;
if (([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown) ||
([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortrait)) {
interfaceOrientation = @"Portrait";
} else {
interfaceOrientation = @"Landscape";
@LavareX
LavareX / iOSOpenDev-Install.sh
Created July 11, 2016 05:49 — forked from jridgewell/iOSOpenDev-Install.sh
A script to install iOSOpenDev
#!/bin/bash
# --------------------------------------------------------------
# iOSOpenDev -- iOS Open Development (http://www.iOSOpenDev.com)
# Copyright (C) 2012 Spencer W.S. James <dev@iosopendev.com>
# --------------------------------------------------------------
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@LavareX
LavareX / Hotkey.ahk
Created May 11, 2016 15:07
热键配置
;~ 热键全局开关
F12::suspend
!x::run,C:\Users\acer\AppData\Local\Google\Chrome\Application\chrome.exe
!m::run,D:\Program Files (x86)\Mozilla Firefox\firefox.exe
!i::run,C:\Program Files (x86)\Internet Explorer\iexplore.exe
!o::run,D:\Program Files (x86)\Opera\opera.exe
;~ !c::run,D:\Program Files\goagent-goagent-546de84\local\goagent.exe
;~ !z::run,D:\Program Files\HideDesktopIcons.exe
[Proxy]
WIFI = direct, interface=en2
VPN = direct, interface=utun0
[Rule]
DOMAIN-SUFFIX,yach.me,WIFI
FINAL,VPN
@LavareX
LavareX / alfred-pinyin.py
Created January 5, 2016 05:27 — forked from tiann/alfred-pinyin.py
make alfred support pinyin search
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# @author weishu @2015/12/7
import subprocess
import os
import re
import json
@LavareX
LavareX / main.conf
Created October 14, 2015 05:08
Surge.conf 使用 114 dns 配合 xuanpg.com 食用
[General]
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local
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.114.114
dns-server = 114.114.114.114, 114.114.115.115
loglevel = notify
[Proxy]
Proxy = http,1,2
@LavareX
LavareX / Fuckgfw.conf
Created October 13, 2015 00:57 — forked from jason5ng32/surge.conf
Surge Config
[General]
loglevel = notify
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
[Proxy]
// ADD YOUR PROXY HERE, DON'T FORGET TO REMOVE #
# Proxy = http,$IP,$PORT,$USERNAME,$PASSWORD
# Proxy = https,$IP,$PORT,$USERNAME,$PASSWORD
#import <Foundation/Foundation.h>
void method1(NSArray *numbers)
{
NSArray *sorted = [numbers sortedArrayUsingSelector:@selector(compare:)];
}
void method2(NSArray *numbers)
{
NSNumber *max=[numbers valueForKeyPath:@"@max.doubleValue"];
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
@LavareX
LavareX / private.xml
Last active August 29, 2015 14:12 — forked from ghawkgu/private.xml
<?xml version="1.0"?>
<root>
<item>
<name>Switch Input Source</name>
<appendix>Use the right Option key to select the next input source</appendix>
<identifier>private.switch_input_source_with_right_option</identifier>
<autogen>--KeyToKey-- KeyCode::OPTION_R, KeyCode::SPACE, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L</autogen>
</item>
<item>