Skip to content

Instantly share code, notes, and snippets.

@susuyan
susuyan / 0_reuse_code.js
Created December 9, 2015 03:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@susuyan
susuyan / Get iOS MAC address.m
Created March 7, 2016 09:32 — forked from Coeur/Get iOS MAC address.m
Get iOS MAC address #
/* Original source code courtesy John from iOSDeveloperTips.com */
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_dl.h>
+ (NSString *)getMacAddress
{
int mgmtInfoBase[6];
@susuyan
susuyan / GLSupprot.h
Created March 7, 2016 09:35 — forked from qingjoin/GLSupprot.h
iOS 经常用到的一些方法
//
// GLSupprot.h
// GameLive
//
// Created by qingyun on 5/3/13.
// Copyright (c) 2013 qingyun. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@susuyan
susuyan / ios_resources.json
Created December 5, 2017 03:33 — forked from heroicyang/ios_resources.json
GitHub 上的 iOS 开源项目
var githubList = [
{
name:'系统基础库',
list: [
{name:'Category/Util',
list: [
{name:'sstoolkit', owner:'soffes', desc:'一套Category类型的库,附带很多自定义控件 功能不错~'},
{name:'BlocksKit', owner:'pandamonia', desc:'将Block风格带入UIKit和Founcation'},
{name:'cocoa-helpers', owner:'enormego', desc:'一些Cocoa的扩展 2年前的工程'},
@susuyan
susuyan / ImageGenerator
Created December 20, 2017 05:34 — forked from CodeEagle/ImageGenerator
Generator for Assets.xcassets , Xcode Run Script
#!/bin/bash
# Generate UIImage extension for images assets, using in Xcode run script
base="$SRCROOT/${TARGET_NAME}"
assertPath="$base/Assets.xcassets"
fileName="$base/ImageResource.swift"
content="import UIKit\nextension UIImage {\n"
prefix="lo_"
DealWithFile() {
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
/** A pthread-based recursive mutex lock. */
public class Mutex {
private var mutex: pthread_mutex_t = pthread_mutex_t()
public init() {
var attr: pthread_mutexattr_t = pthread_mutexattr_t()
pthread_mutexattr_init(&attr)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE)
let err = pthread_mutex_init(&self.mutex, &attr)
@susuyan
susuyan / .travis.yml
Created December 3, 2019 09:04 — forked from aterribili/.travis.yml
iOS + Travis + Fastlane continuous delivery
language: objective-c
os: osx
xcode_workspace: {workspace-name}.xcworkspace
xcode_scheme: {workspace-name}
xcode_sdk: iphonesimulator9.0
osx_image: xcode8
before_install:
- |
brew update
gem install xcpretty -N --no-ri --no-doc