Skip to content

Instantly share code, notes, and snippets.

View eugenpirogoff's full-sized avatar
🖖
making

Eugen Pirogoff eugenpirogoff

🖖
making
View GitHub Profile
@smileart
smileart / README.md
Last active March 16, 2024 15:42 — forked from agnoster/README.md
My ZSH Theme — Agnoster Mod

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@linjunpop
linjunpop / Objective-C-for-Rubyist.md
Last active November 28, 2018 12:18
Objective-C for Rubyist.

Objective-C for Rubyist

Basic Syntax

Message

[you say:@"Hello."];
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@matthiasplappert
matthiasplappert / uikonf2014-slides.md
Last active November 28, 2018 13:04
UIKonf 2014 Slides
@marcdown
marcdown / BKLNSwiftPresenters.md
Last active November 5, 2017 03:08
Brooklyn Swift Developers Meetup Presenters
@andyyhope
andyyhope / SwiftEvolution_EnumCaseCountFunctionality_AndyyHope.md
Last active March 12, 2020 13:05
Swift Evolution - Enum Case Count Functionality

Swift Evolution Proposal

Author: Andyy Hope

Enum Values() Functionality (Update)

It has been brought to my attention that there was more use for the unintended values() functionality that I had outline in my "Other Languages" Java example below.

On the Swift Evolution mailing list, one developer outlined their requirement to loop through an array of enum case values to add different states to objects.

Another example where a values array would be useful if the developer wants to do something different for each different case, such as setting an image on a UIButton subclass for each different UIControlState

@eduncan911
eduncan911 / go-build-all
Last active April 11, 2024 07:14
Go Cross-Compile Script
#!/bin/bash
#
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
#
# To use:
#
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
#
@KyleGoslan
KyleGoslan / UIImage+Extension.swift
Created November 27, 2016 21:47
Resize UIImage Swift 3
import UIKit
extension UIImage {
func resizeWith(percentage: CGFloat) -> UIImage? {
let imageView = UIImageView(frame: CGRect(origin: .zero, size: CGSize(width: size.width * percentage, height: size.height * percentage)))
imageView.contentMode = .scaleAspectFit
imageView.image = self
UIGraphicsBeginImageContextWithOptions(imageView.bounds.size, false, scale)
guard let context = UIGraphicsGetCurrentContext() else { return nil }
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 5, 2024 06:09
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@susnmos
susnmos / common.cy
Created June 15, 2017 17:10
A script for cycript
// 打印按钮的action及其target
function actionWithTargets(button) {
var allTargets = [button allTargets].allObjects();
if (!allTargets) {
return "is not a uicontrol"
}
var allShow = [];
for (var i = 0; i < allTargets.length; i++) {
var target = allTargets[i];
var actions = [button actionsForTarget: target forControlEvent: UIControlEventTouchUpInside];