Skip to content

Instantly share code, notes, and snippets.

View nonstriater's full-sized avatar

移动开发小冉 nonstriater

View GitHub Profile
@hellokaton
hellokaton / mac-multiple-version.md
Last active January 2, 2025 06:41
mac下多个jdk版本共存

修改系统环境变量,以自如的切换多个版本的 jdk

vi ~/.bash_profile 并填写下文内容
source ~/.bash_profile // 刷新环境变量
java -version // 查看当前的 jdk 版本

需要填写的内容为:

@jingzhehu
jingzhehu / CMakeLists.txt
Created February 26, 2017 15:36
Clion meets bitcoin.
cmake_minimum_required(VERSION 3.3)
project(bitcoin)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_custom_target(build-bitcoin ALL
COMMAND ./autogen.sh
COMMAND ./configure
COMMAND $(MAKE) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@brunojppb
brunojppb / AppDelegate.m
Created January 23, 2017 15:24
Allow landscape mode in specific ViewControllers
/* Allow Landscape mode for specific ViewControllers */
-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
UIViewController* topVC = [self topViewControllerWith: self.window.rootViewController];
if ([topVC respondsToSelector:@selector(canRotate)]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
return UIInterfaceOrientationMaskPortrait;
}
/* get the top ViewController */
//
// Created by Chenyu Lan on 8/27/14.
// Copyright (c) 2014 Fenbi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "YTKNetworkConfig.h"
#import "YTKBaseRequest.h"
// 给url追加arguments,用于全局参数,比如AppVersion, ApiVersion等
@joshhudnall
joshhudnall / UIAlertViewCrashFix.h
Created April 28, 2015 23:13
A potential fix to a new crash in iOS 8.3 where UIAlertViews will crash because they expect a different auto rotation behavior than what they are getting.
//
// UIAlertViewCrashFix.h
//
// Created by Josh Hudnall on 4/28/15.
//
//
#import <Foundation/Foundation.h>
@interface UIAlertController (CrashFix)
@leecade
leecade / refreshPluginsAfterXcodeUpgrading.sh
Created April 12, 2015 20:18
bash:refreshPluginsAfterXcodeUpgrading
#!/bin/bash
#获取当前版本Xcode的DVTPlugInCompatibilityUUID
UUID=$(defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID)
echo Xcode DVTPlugInCompatibilityUUID is $UUID
#遍历每一个Xcode插件,将UUID写入插件的兼容列表中
for MyPlugin in ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/*
do
defaults write "$MyPlugin"/Contents/Info DVTPlugInCompatibilityUUIDs -array-add $UUID
echo write DVTPlugInCompatibilityUUID to $MyPlugin succeed!
done
@bang590
bang590 / linkmap.js
Last active August 6, 2024 14:59
XCode Linkmap Parser
var readline = require('readline'),
fs = require('fs');
var LinkMap = function(filePath) {
this.files = []
this.filePath = filePath
}
LinkMap.prototype = {
start: function(cb) {
@vitorbritto
vitorbritto / rm_mysql.md
Last active February 28, 2025 09:58
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@iblacksun
iblacksun / gist:9487200
Created March 11, 2014 14:44
ALAssetsLibraryChangedNotification
-(void)startMonitor{
//[ALAssetsLibrary disableSharedPhotoStreamsSupport];
[self requireAssetsLibraryAuthorization];
self.assetsLibrary = [[ALAssetsLibrary alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(assetsChanged:) name:ALAssetsLibraryChangedNotification object:nil];
[self.assetsLibrary writeImageToSavedPhotosAlbum:nil metadata:nil completionBlock:^(NSURL *assetURL, NSError *error){}];
}
-(void)assetsChanged:(NSNotification *)notification{
@m1entus
m1entus / build-ffmpeg.sh
Last active June 22, 2024 04:06
Installing ffmpeg ios libraries armv7, armv7s, i386
#!/bin/bash
###########################################################################
# Choose your ffmpeg version and your currently-installed iOS SDK version:
#
VERSION="2.0.2"
SDKVERSION="7.0"
ARCHS="armv7 armv7s i386"
#
#