Skip to content

Instantly share code, notes, and snippets.

View mokagio's full-sized avatar
🛠️
Building stuff

Gio Lodi mokagio

🛠️
Building stuff
View GitHub Profile
@AliSoftware
AliSoftware / git-groom
Last active December 7, 2021 15:46
Sync git working copies' trunk and develop branches and prune local and remote deleted/orphan branches
#!/bin/bash -euo pipefail
#
# Author: O.Halligon
# Jan 2021
#
# Help
if [ "${1:-}" == "-h" -o "${1:-}" == "--help" ]; then
BASENAME=${0##*/}
#!/bin/bash
# taken from blog post: http://www.mokacoding.com/blog/automatic-xcode-versioning-with-git/
# Automatically sets version of target based on most recent tag in git
# Automatically sets build number to number of commits
#
# Add script to build phase in xcode at the top of the chain named "set build number"
# put this script in the root of the xcode project in a directory called scripts (good idea to version control this too)
# call the script as $SRCROOT/scripts/set_build_number.sh in xcode
@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node

The 5-minute backpack demo

Here's what I carry in a Tom Bihn Synapse 19 bag when I travel for 1-to-n days. In general, I optimize for low-weight items, with a secondary focus on reducing maintenance. You can peruse a gallery of pictures, too.

Clothing

@sharplet
sharplet / Example.swift
Created November 3, 2017 17:46
An improved wrapper for UIImagePickerController
// Here is a usage example. Refer to ImagePicker.swift below for the implementation!
// 1. Easily configure the picker
let cameraPicker = ImagePicker(sourceType: .camera)
let cropPicker = ImagePicker(sourceType: .photoLibrary, allowsEditing: true)
// Automatically includes both kUTTypeImage and kUTTypeLivePhoto
let livePhotoPicker = ImagePicker(sourceType: .photoLibrary, mediaTypes: [.livePhotos])
// 2. Use the picker
@phynet
phynet / bridging-error.mkd
Last active August 13, 2020 20:35
implicit import bridging header in module is deprecated

now in swift 4 you just have to import a briding header into Test target and reference objc-class .h files there...using @testable import nameOfYourApp should work

In Swift there's a message in "Test Target" that states that the bridging header will be removed in newer versions of swift. I'm using mixed objc and swift clasess, but the UnitTest class is a swift file. Using @testable key was there in code

  @testable import YourProject

You fix it by adding in your Test area the bridging header with objc headers that your test will use:

@hipertracker
hipertracker / Nested.elm
Last active September 13, 2018 14:05
Decoding nested JSON string
module Nested exposing (api)
import Json.Decode exposing (at, int, string, list, decodeString, Decoder)
import Json.Decode.Pipeline exposing (decode, required, optional, hardcoded)
data : String
data =
"""
{"languages":
@bjeanes
bjeanes / docker-buildkite-ubuntu-14.04.sh
Last active May 30, 2016 06:08
Little script for me to pipe over SSH to a fresh Ubuntu VPS/VM to get it running a docker agent (used with cloudatcost.com as cheap build boxes)
#!/usr/bin/env bash
if [ -z "$BUILDKITE_AGENT_TOKEN" ]; then
echo
>&2 echo "No buildkite agent token set! Set BUILDKITE_AGENT_TOKEN"
exit 1
fi
touch ~/.ssh/authorized_keys
chmod 700 ~/.ssh
@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

@PurpleBooth
PurpleBooth / README-Template.md
Last active April 26, 2024 01:29
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites