Skip to content

Instantly share code, notes, and snippets.

View iwill's full-sized avatar
Growing Well 🌱🌱

Míng iwill

Growing Well 🌱🌱
View GitHub Profile
@iwill
iwill / brew-perms.sh
Last active April 16, 2018 13:02 — forked from jaibeee/brew-perms.sh
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin $(brew --prefix)/*
chmod -R g+w $(brew --prefix)/*
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@iwill
iwill / Masonry+M9Ext.h
Created November 27, 2017 05:04
A Masonry Extension supports iOS 11 safeAreaLayoutGuide, @see https://github.com/SnapKit/Masonry/pull/473
//
// Masonry+M9Ext.h
// M9Dev
//
// Created by MingLQ on 2017-04-05.
// Copyright © 2017 MingLQ <[email protected]>. Released under the MIT license.
//
#import <Masonry/Masonry.h>

Objective-C Coding Convention and Best Practices

Most of these guidelines are to match Apple's documentation and community-accepted best practices. Some are derived some personal preference. This document aims to set a standard way of doing things so everyone can do things the same way. If there is something you are not particularly fond of, it is encouraged to do it anyway to be consistent with everyone else.

This document is mainly targeted toward iOS development, but definitely applies to Mac as well.

Operators

NSString *foo = @"bar";

#The Great Firewall (GFW) Contributors List

注:数据来源为 dblp 和 cndblp, 下面括号中的数字表示 dblp 中显示的跟方滨兴合作论文的数量

###Binxing Fang (方滨兴)

中国工程院院士,北京邮电大学教授,中国科学院计算技术研究所网络方向首席科学家
http://en.wikipedia.org/wiki/Fang_Binxing

@iwill
iwill / color-legend.sh
Last active September 29, 2022 02:14
color-legend.sh
#!/bin/bash
# http://ss64.com/bash/echo.html
echo -n -e " "
for j in {40..47}; do
echo -n -e " bj-$j "
# Reset text attributes to normal without clear
tput sgr0
done
@iwill
iwill / git-cb.sh
Last active October 30, 2023 09:19
git checkout with grep patterns
#!/bin/bash
# alias in gitconfig:
# cb = "!sh ~/.git-cb.sh"
# usage:
# git cb ev lo # *ev*lo* - `develop` will be matched
# cb = "!checkoutbranch() { local branches=`git branch | grep -i $1 | tr -d '* '`; if [[ `echo \"$branches\" | wc -l | tr -d ' '` != 1 ]]; then echo \"Matched multiple branches:\"; git branch | grep --color -i $1; exit 1; fi; git checkout $branches; }; checkoutbranch"
branches=`git branch`
@iwill
iwill / css_resources.md
Created May 28, 2014 10:42 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@iwill
iwill / javascript_resources.md
Created May 28, 2014 10:41 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
//
// NSObject+Blocks.h
// Filemator
//
// Created by Zachary Waldowski on 4/12/11.
// Copyright 2011 Dizzy Technology. All rights reserved.
//
@interface NSObject (Blocks)
@iwill
iwill / newbash.sh
Created March 25, 2014 02:26
newbash
# new bash script and mate
function newbash() {
if [[ ! -f "$1" ]]; then
echo '#!/bin/bash' > "$1"
fi
if [[ -f "$1" ]]; then
chmod +x "$1"
mate "$1"
fi
}