Skip to content

Instantly share code, notes, and snippets.

@markeissler
markeissler / yardoc_cheatsheet.md
Created December 3, 2012 22:40 — forked from chetan/yardoc_cheatsheet.md
YARD cheatsheet

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
@markeissler
markeissler / blocks.m
Created April 3, 2014 22:37
How Do I Declare a Block in Objective-C? (With Xcode snippets)
// How Do I Declare A Block in Objective-C?
//
// Source: http://fuckingblocksyntax.com/
//
// Xcode snippets
// As a local variable:
<#returnType#> (^<#blockName#>)(<#parameterTypes#>) = ^<#returnType#>(<#parameters#>) {
<#code#>
};

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

/*
Some sample code for a horizontal paged UIScrollView with a gap between each image (which looks nicer). Note - not using contentInset, we want each page to fill the iPhone screen and the gap only to be visible when scrolling (like Photos.app).
Taking the iPhone status bar into account - our viewport is 320x460
Our UIScrollView is therefore set in Interface Builder to 340x460 with a -10 X offset (so it's larger than the viewport but still centred)
Then we do the following...
*/
// Our image filenames
ps -A | grep diskimages-helper | awk '{print $1}' | xargs kill -9
@markeissler
markeissler / .gitconfig
Last active August 29, 2015 14:07 — forked from VonC/.gitconfig
[user]
name = VonC
email = vonc@laposte.net
[core]
; just making sure those eol's stay as they are
autocrlf = false
; see http://stackoverflow.com/a/22208863/6309 (Git/Bash is extremely slow in Windows 7 x64, until fix in msysgit 1.9.4)
fscache = true
[alias]
; from http://www.jukie.net/bart/blog/pimping-out-git-log, with author displayed
@markeissler
markeissler / custom_callouts.md
Created October 27, 2015 03:12 — forked from ShadoFlameX/custom_callouts.md
Custom Map Annotation Callouts on iOS
  1. Create a UIView subclass for the pin callout view.
  2. Create a subclass of MKAnnotationView for your map pins.
  3. Add an instance of the callout view subclass to your MKAnnotationView subclass.
  4. Add a property to toggle the callout view to your MKAnnotationView subclass. This example fades in/out:
    - (void)setShowCustomCallout:(BOOL)showCustomCallout
    {
        [self setShowCustomCallout:showCustomCallout animated:NO];
    }
    
@markeissler
markeissler / fa-icon-external-link.css
Created December 3, 2015 06:41 — forked from 01-Scripts/fa-icon-external-link.css
Show icon after external link using Font Awesome
@markeissler
markeissler / golang-tls.md
Created September 3, 2016 20:34 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key