Skip to content

Instantly share code, notes, and snippets.

View alexandreraulin's full-sized avatar

Alexandre Raulin alexandreraulin

View GitHub Profile
@hamdan
hamdan / MultipleTapLabel.swift
Last active November 15, 2023 21:26
Create Multiple Tappable Links in a UILabel
extension UITapGestureRecognizer {
func didTapAttributedTextInLabel(label: UILabel, targetText: String) -> Bool {
guard let attributedString = label.attributedText, let lblText = label.text else { return false }
let targetRange = (lblText as NSString).range(of: targetText)
//IMPORTANT label correct font for NSTextStorage needed
let mutableAttribString = NSMutableAttributedString(attributedString: attributedString)
mutableAttribString.addAttributes(
[NSAttributedString.Key.font: label.font ?? UIFont.smallSystemFontSize],
range: NSRange(location: 0, length: attributedString.length)
@candostdagdeviren
candostdagdeviren / pre-commit
Last active April 22, 2023 09:32
Git Pre-Commit hook with SwiftLInt
#!/bin/bash
#Path to swiftlint
SWIFT_LINT=/usr/local/bin/swiftlint
#if $SWIFT_LINT >/dev/null 2>&1; then
if [[ -e "${SWIFT_LINT}" ]]; then
count=0
for file_path in $(git ls-files -m --exclude-from=.gitignore | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path
@cabeca
cabeca / simulator_populator_xcode7
Last active April 16, 2020 09:18
This script removes and recreates all simulators in Xcode 7.
#!/usr/bin/env ruby
require 'JSON'
device_types = JSON.parse `xcrun simctl list -j devicetypes`
runtimes = JSON.parse `xcrun simctl list -j runtimes`
devices = JSON.parse `xcrun simctl list -j devices`
devices['devices'].each do |runtime, runtime_devices|
runtime_devices.each do |device|
@CoffeePirate
CoffeePirate / se_server_linux.md
Last active March 24, 2024 22:03
A quick guide how to setup Space Engineers Dedicated server on a Linux box with Wine

Ubuntu 14.04/14.10 SpaceEngineers Dedicated Server

Here's a quick guide how to run SpaceEngineers Dedicated Server on Ubuntu with Wine

Requirements

  • A copy of Space Engineers
  • A Windows box
  • A Linux box running Ubuntu 14.04 or 14.10 (It'll probably work on other distros, YMMV)

Step #1: Install & configure Wine1.6 and dependencies

@JeOam
JeOam / FLEX.md
Created October 21, 2014 06:40
Flipboard FLEX: An in-app debugging and exploration tool for iOS

FLEX (Flipboard Explorer) is a set of in-app debugging and exploration tools for iOS development. When presented, FLEX shows a toolbar that lives in a window above your application. From this toolbar, you can view and modify nearly every piece of state in your running application.

Installation via Cocoapods

pod 'FLEX', '~> 1.1'

Setup in project: AppDelegate.m

@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 7, 2024 09:29
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@bobmoff
bobmoff / UIView+RoundedCorners.h
Created July 10, 2013 15:23
Add rounded corners to any view using layer mask.
#import <UIKit/UIKit.h>
@interface UIView (RoundedCorners)
- (void)setRoundedCorners:(UIRectCorner)corners radius:(CGSize)size;
@end