Skip to content

Instantly share code, notes, and snippets.

@philosopherdog
philosopherdog / a_qwerty.txt
Last active March 27, 2021 20:13
Kinesis Advantage 2 Mappings
[caps]>[escape][t&h250][lwin]
[=]>[=][t&h250][hyper]
[\]>[\][t&h250][meh]
[scroll]>[shutdn]
[kp=]>[kp=mac]
[kp-lctrl]>[kp-lwin]
[rctrl]>[rwin]
[kp-rctrl]>[kp-rwin]
[kp-rwin]>[kp-rctrl]
[delete]>[lwin]
@jerrymarino
jerrymarino / run_ios_sim.sh
Last active April 7, 2024 08:45
Build and run an iOS application on the simulator from the command line
#!/bin/bash
# run_ios_sim builds and runs an iOS app on the simulator
#
# It is designed to replicate the behavior of "Run" in Xcode and assumes basic
# xcodebuild usage.
#
# USAGE:
# export IOS_SIM_UDID=342F9A20-DF48-41A9-BE60-C6B35F47E97F; \
# export BUNDLE_IDENTIFIER=a.Some; \
# export APP_PATH=$PWD/Build/Debug-iphonesimulator/$APP_NAME.app \
@dulacp
dulacp / Overlay_iOS_app_version_on_icon_README.md
Last active November 19, 2017 11:18
Overlay the iOS application version on top of the icon

Usage

Requirements

Install the two dependencies, ImageMagick and Ghostscript.

$ brew install imagemagick
$ brew install ghostscript
@kristopherjohnson
kristopherjohnson / subclassAndProtocol.swift
Last active August 29, 2015 14:04
Function that takes an argument that must be a subclass of a specified class, and that subclass must implement a specified protocol
protocol CanBark {
func bark() -> String
}
class Animal {
func animalType() -> String {
return "Animal"
}
}
@branneman
branneman / better-nodejs-require-paths.md
Last active April 8, 2024 00:22
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@kugaevsky
kugaevsky / cleanup_all_gemsets.sh
Last active November 15, 2017 16:49
Cleanup outdated gems from all your rvm gemsets
#!/bin/sh
echo "NB! This process could be too destructive sometimes and you may need to run 'bundle' command from your project directory."
echo "Do you want to cleanup all gemsets?"
read -p "(anything other than 'yes' will cancel) > " ANSWER
if [[ $ANSWER != "yes" ]]
then
echo "Phew...\nMay be another day."
else
@angelolloqui
angelolloqui / UIImage+H568.m
Last active October 6, 2022 16:35
iPhone5 UIImage method swizzling to load -568h images
//
// UIImage+H568.m
//
// Created by Angel Garcia on 9/28/12.
// Copyright (c) 2012 angelolloqui.com. All rights reserved.
//
#import <objc/runtime.h>
@implementation UIImage (H568)
@insin
insin / bash_prompt.sh
Created December 3, 2011 01:49 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.