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>
//
// DSNavigationBar.h
// DSTranparentNavigationBar
//
// Created by Diego Serrano on 10/13/14.
// Copyright (c) 2014 Diego Serrano. All rights reserved.
//
#import <UIKit/UIKit.h>
//
// Defines.h
// BMLine
//
// Created by NADA_BM on 15/10/21.
// Copyright © 2015年 NADA_BM. All rights reserved.
//
#ifndef Defines_h
#define Defines_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() {
/*
1. 是否登录
*/
private func setupSplash(){
// let adView = ZLaunchAd.create(waitTime:3)
//
// let api = Networking.newNoHUDNetworking()
// api.request(.showScreen, success: { result in
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let identifier = segue.identifier else {
return
}
switch identifier {
case "PushMusicMenuList":
default:
break
extension WelfareStoreController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if selectedIndexPath == nil {
selectedIndexPath = indexPath
let cell = tableView.cellForRow(at: indexPath) as? WelfareStoreCell
cell?.selectedState = true
}else {
let celled = tableView.cellForRow(at: selectedIndexPath!) as? WelfareStoreCell
celled?.selectedState = false
selectedIndexPath = indexPath