Skip to content

Instantly share code, notes, and snippets.

View inket's full-sized avatar
😷
Busy with life

Mahdi Bchatnia inket

😷
Busy with life
View GitHub Profile
@liamdon
liamdon / gist:2467603
Created April 22, 2012 23:53
CoffeeScript, Jade and Stylus syntax highlighting in Sublime Text 2

Step 1: Clone the bundles into your Sublime Text packages directory

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus

Step 2: Restart Sublime Text 2

@sburlot
sburlot / xc_ramdisk.sh
Created March 8, 2014 15:03
Creates a ramdisk and start Xcode with the DerivedData stored in ramdisk. Also deletes the ramdisk and reset Xcode prefs.
#!/bin/bash
# Creates a ramdisk and start Xcode with the DerivedData stored in ramdisk. Also deletes the ramdisk and reset Xcode prefs.
# xc_ramdisk.sh
# - creates a ramdisk, set Xcode DerivedData to this disk and start Xcode.
# - umount a ramdisk, set Xcode DerivedData to default
# Stephan Burlot, Coriolis Technologies, http://www.coriolis.ch
#
# based on Alex Shevchenko xcode_ramdisk.sh script (https://gist.github.com/skeeet/2367298)
# based on Diego Freniche xc-launch.sh script (https://github.com/dfreniche/xc-launch)
@calebd
calebd / ArrayHelpers.swift
Last active November 4, 2022 15:17
Swift Helpers
extension Array {
func first() -> Element? {
if isEmpty {
return nil
}
return self[0]
}
func last() -> Element? {
@balupton
balupton / README.md
Last active June 20, 2021 09:54
Instances of popular open-sourcers duplicating packages and blocking people

It seems some open-sourcers strategies may have been to gain fame from finding existing packages then duplicating them (with the exact same functionality, or a subset or superset) instead of sending PRs or using existing solutions. Package maintainers can want to do this to build up a portfolio of popular packages, to consolidate popularity and power to themselves, and thus gain funding. Willfull ignorance of alternatives at the time of publishing stems from the similar intention. Naivity however may be accidental, in which case consolidation of duplicates can be a desired outcome where possible, as it consolidates maintainership and features for a better user experience. There is valid reason for duplication however, where an original author was not receptive to pull requests.

This gist is to look into such instances. It is not to say whether or a case was accidental or not. Only that such duplication exists, in the hope that it can be noted and hopefully resolved.

Eventually one could do up a programmatic

@simonliotier
simonliotier / SwiftUI+CustomFonts+DynamicType.swift
Last active December 11, 2019 14:27
Example of how to get Dynamic Type with custom fonts in SwiftUI
import SwiftUI
/// Example of how to get Dynamic Type with custom fonts in SwiftUI.
struct ContentView: View {
var body: some View {
VStack(spacing: 20) {
Text("A large title").customFont(.largeTitle) // "Optima-ExtraBlack", 28
Text("A body").customFont(.body) // "Kailasa", 16
Text("A caption").customFont(.caption2) // "IowanOldStyle-Italic", 11
}
@inket
inket / PreviewScreenshot.swift
Last active July 19, 2024 20:19
How to take screenshots of SwiftUI previews
#if DEBUG
import SwiftUI
private let screenshotDirectory = "/Users/inket/Desktop/"
struct PreviewScreenshot: ViewModifier {
struct LocatorView: UIViewRepresentable {
let tag: Int
func makeUIView(context: Context) -> UIView {