Skip to content

Instantly share code, notes, and snippets.

View Rag0n's full-sized avatar

Alexander Guschin Rag0n

View GitHub Profile
@burdiuz
burdiuz / metro.config.js
Created December 5, 2019 19:50
Metro bundler config as replacement for rn-nodeify, substitutes nodejs modules for dependencies
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
const path = require('path');
module.exports = {
@sundeepgupta
sundeepgupta / create-fat-framework.sh
Last active December 16, 2024 20:58
Script to create a universal or "fat" binary for an iOS framework.
#!/bin/bash
# Adapted from http://stackoverflow.com/questions/24039470/xcode-6-ios-creating-a-cocoa-touch-framework-architectures-issues/26691080#26691080
# and https://gist.github.com/cromandini/1a9c4aeab27ca84f5d79
# Create a new aggregate target.
# For the automatically generated scheme, change its build config to "release".
# Ensure this target's "product name" build setting matches the framework's.
# Add a run script with `source "${PROJECT_DIR}/path_to_this_script`
@ollieatkinson
ollieatkinson / HTTPStatusCode.swift
Last active April 12, 2025 22:44
HTTP status codes as a Swift enum.
/// This is a list of Hypertext Transfer Protocol (HTTP) response status codes.
/// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes.
/// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum.
enum HTTPStatusCode: Int, Error {
/// The response class representation of status codes, these get grouped by their first digit.
enum ResponseType {
/// - informational: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.
case informational
@Rag0n
Rag0n / tmux-cheatsheet.markdown
Last active November 14, 2015 18:05 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@paulofierro
paulofierro / wkwebview_disable_callouts.m
Created July 13, 2015 22:43
Disable callouts in WKWebView
// Remember to @import WebKit at the top of the class
// Javascript that disables pinch-to-zoom by inserting the HTML viewport meta tag into <head>
NSString *source = @"var style = document.createElement('style'); \
style.type = 'text/css'; \
style.innerText = '*:not(input):not(textarea) { -webkit-user-select: none; -webkit-touch-callout: none; }'; \
var head = document.getElementsByTagName('head')[0];\
head.appendChild(style);";
WKUserScript *script = [[WKUserScript alloc] initWithSource:source injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
@mbalex99
mbalex99 / gist:8802db1695f20c520ca0
Last active May 22, 2022 11:58
Alamofire and RxSwift
let rx_request = Observable<Value>.create { (observer) -> Disposable in
let requestReference = Alamofire.request(.POST, url, parameters: payload)
.responseJSON(completionHandler: { (response) in
if let value = response.result.value {
observer.onNext(value)
observer.onCompleted()
}else if let error = response.result.error {
observer.onError(error)
}
})
@rbobbins
rbobbins / value_types.md
Created June 12, 2015 22:09
Build Better Apps with Value Types in Swift

Build Better Apps with Value Types in Swift

Agenda

  • Reference semantics
  • Immutability
  • Value semantics
  • Value types in practice
  • Mixing value types and reference types

Reference semantics

@rbobbins
rbobbins / cocoa_touch_best_practices.md
Created June 12, 2015 21:13
Cocoa Touch Best Practices

Cocoa Touch Best Practices

Speaker: Luke Hiesterman, UIKit Engineer

Agenda

  • App lifecycle
  • Views and view controllers
  • Auto layout
  • Table and collection views

Goals