Skip to content

Instantly share code, notes, and snippets.

View eneko's full-sized avatar
💻

Eneko Alonso eneko

💻
View GitHub Profile
@rodneyrehm
rodneyrehm / gist:40e7946c0cff68a31cea
Last active November 7, 2022 09:11
Diagrams for Documentation

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@s-aska
s-aska / Keychain.swift
Last active September 16, 2022 03:37
Swift Keychain class ( supported Xcode 6.0.1 )
import UIKit
import Security
class Keychain {
class func save(key: String, data: NSData) -> Bool {
let query = [
kSecClass as String : kSecClassGenericPassword as String,
kSecAttrAccount as String : key,
kSecValueData as String : data ]
import lldb
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f SwiftPrinter.printer pjson')
def printer(debugger, command, result, internal_dict):
debugger.HandleCommand('p print(String(data: try! JSONSerialization.data(withJSONObject:' + command + ', options: .prettyPrinted), encoding: .utf8 )!)')
@Clarko
Clarko / ConvenientColors.swift
Last active July 24, 2020 15:40
SwiftUI Color Extension
//
// ConvenientColors.swift
//
// Created by Clarko on 7/15/20.
//
// Color.primary and Color.secondary are great for foreground text
// that adapts in light & dark mode, but there are a lot more
// UI Element Colors in iOS and macOS:
//
// https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors
@davidjrice
davidjrice / .travis.yml
Last active October 23, 2019 16:17 — forked from johanneswuerbach/.travis.yml
Travis CI + TestFlight integration (updated for Travis' new Mac VM setup / xctool)
language: objective-c
xcode_workspace: "<WorkspaceName.xcworkspace>"
xcode_scheme: "<SchemaName>"
script: xctool -workspace <WorkspaceName.xcworkspace> -scheme <SchemeName> -configuration Release build archive
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
class GroupersController < ApplicationController::Base
def create
@grouper = Grouper.new(leader: current_member)
if @grouper.save
confirm_grouper_via_emails(@grouper)
enqueue_bar_assignment(@grouper)
redirect_to home_path
else
struct Memoized<A: Equatable, R> {
typealias Value = (_ params: A) -> R
var callback: Value
@XState private var prevParam: A? = nil
@XState private var prevValue: R? = nil
init(_ callback: @escaping Value) {
self.callback = callback
}
@claybridges
claybridges / xcbuild-safe.sh
Last active September 26, 2018 18:21
Drop in replacement/wrapper for xcodebuild, fixes Xcode 7 build dependency on system ruby vs. rvm. Explained further @ http://stackoverflow.com/questions/33041109.
#!/bin/bash --login
# Cf. http://stackoverflow.com/questions/33041109
#
# Xcode 7 (incl. 7.0.1) seems to have a dependency on the system ruby.
# xcodebuild is screwed up by using rvm to map to another non-system
# ruby†. This script is a fix that allows you call xcodebuild in a
# "safe" rvm environment, but will not (AFAIK) affect the "external"
# rvm setting.
#
{% assign url_split = page.url | replace_first: "/" | split:"/" %}
{% assign url_size = url_split.size %}
<ol class="breadcrumb">
{% if url_size < 1 %}
<li class="active">Home</li>
{% else %}
<li><a href="/">Home</a></li>
{% endif %}
@duemunk
duemunk / Guilty
Last active June 23, 2016 12:11
Operator overload badge
<img src="http://img.shields.io/badge/Operator_overload-guilty-red.svg" height="20" alt="Uses operator overloads"/>