Skip to content

Instantly share code, notes, and snippets.

@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@martinbean
martinbean / pre-commit
Last active December 19, 2023 22:14
Pre-commit hook to detect if any .php files contain dd()
#!/usr/bin/php
<?php
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD | grep "\.php$"');
$files = explode("\n", trim($files));
$exitCode = 0;
foreach ($files as $file) {
if (empty($file)) {
@jonathan-beebe
jonathan-beebe / Xcode support newer iOS builds
Created October 26, 2015 15:59
Enable Xcode to support installing iOS apps on devices running newer version of iOS
- Go to newer version of Xcode, e.g. Xcode 7, in the Finder
- Right click and show package contents
- Navigate to `Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/`
- Copy the `9.0 (13A340)` folder
- Go to older version of Xcode, e.g. Xcode 6.4, in the Finder
- Right click and show package contents
- Navigate to `Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/`
- Paste the iOS 9 folder
- Restart Xcode
@vinceallenvince
vinceallenvince / README.md
Last active April 13, 2019 05:24
CI with Travis, github Releases API, gh-pages and npm publish

CI with Travis, GitHub Releases API and gh-pages

When hosting a project on GitHub, it's likely you'll want to use GitHub Pages to host a public web site with examples, instructions, etc. If you're not using a continuous integration service like Travis, keeping your gh-pages site up to date requires continuous wrangling.

The steps below outline how to use Travis CI with GitHub Releases and GitHub Pages to create a "1-button" deployment workflow. After testing and running a release build, Travis will upload your release assets to GitHub. It will also push a new version of your public facing site to GitHub Pages.

Organize your project

Let's assume you are hosting a JavaScript project that will offer a single JavaScript file as a release asset. It's likely you'll organize your files like this.

@suvarshibhadra
suvarshibhadra / ssingleton.swift
Last active August 29, 2015 14:02
Swift Singleton
class CRBrandManagerSwift:NSObject
{
class func shared()->CRBrandManagerSwift{
struct Static{
static let s_manager = CRBrandManagerSwift();
}
return Static.s_manager;
}
}
@hugosenari
hugosenari / .gitconfig-alias
Last active January 11, 2019 17:14
git + jira(atlassian) + stash(atlassian)
# 'BNAME' = current branch name
# 'BDESC' = current branch description
# return the name of current branch
bname = rev-parse --abbrev-ref HEAD
# get/set description for current branch
bdesc = "!f() { BNAME=`git bname`; if [ $# -gt "0" ]; then BNAME=$1; fi; if [ $# -lt "2" ]; then git config branches.$BNAME.description; else git config branches.$BNAME.description \"$2\"; fi; }; f"
# create new branch with $1 as BNAME and $2 as BDESC, push to vp
[idcmp@idcmp ~]$ cat ~/bin/git-start
#!/bin/bash
PREFIX=`date +%b%d | tr [:upper:] [:lower:]`
if [ -z "$1" ]; then
echo "Please specify the jira issue."
exit 1
fi
@Vinai
Vinai / fix-url-keys.php
Last active September 2, 2022 16:24
This fixes the duplicate url_key issue in a Magento 1.8 / 1.13 installation.
<?php
/**
* Drop this into the shell directory in the Magento root and run with -h to see all options.
*/
require_once 'abstract.php';
/**
* Fix duplicate url keys for categories and products to work with the 1.8 alpha1 CE url key constraints.
@robdodson
robdodson / Default (OSX).sublime-keymap
Created March 30, 2013 17:12
open current file in finder
{ "keys": ["super+shift+o"], "command": "open_dir", "args": {"dir": "$file_path", "file": "$file_name"} }
@mshmsh5000
mshmsh5000 / gist:4664829
Last active December 11, 2015 21:48
Magento: Temporary fix for failed configuration saves. See http://screencast.com/t/7yGn07BMGSY
<?php
// app/code/core/Mage/Adminhtml/Model/Config/Data.php: 135:
/**
* Get field backend model
*/
$backendClass = $fieldConfig->backend_model;
if (!$backendClass) {
$backendClass = 'core/config_data';