Skip to content

Instantly share code, notes, and snippets.

@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;
}
}
@abraham
abraham / index.html
Created October 29, 2012 02:50
ADN Widgets alpha install instructions
<html>
<head>
<!-- ADN Widgets alpha -->
<!-- Sign up for alpha deprecation announcements: https://groups.google.com/forum/#!forum/adn-widgets-announce -->
<!-- To install: include script on your web site and add the <a> tag where you want the follow button -->
<!-- Tested to work in the latest Chrome, Firefox, Safari, and IE9 -->
<!-- ADN Widgets: https://alpha.app.net/widgets -->
<script async src='https://adnwidgets.herokuapp.com/alpha.js'></script>
</head>
@mikeyledoux
mikeyledoux / jQuery Lib Loader
Last active October 14, 2015 00:27
Use this to load in a JS dependency on the fly, FROM your other js files. [usage examples at the bottom] Background: Sometimes we don't want to load every JS file we use on every page, because only certain pages use them. Sometimes we may not want to have to use our application framework make the decision about which JS file(s) to use. NOTE: Thi…
var myLIB = {
desc: 'This thing does neato stuff'
};
myLIB.init = function (lib_type, callback) {
"use strict";
if (typeof lib_type !== 'undefined'){
renderScript();
}
function renderScript() {
@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';
@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
@garnaat
garnaat / update_key.py
Created February 10, 2012 17:25
Update the content-type of an existing key in S3 using boto
import boto
s3 = boto.connect_s3()
bucket = s3.lookup('mybucket')
key = bucket.lookup('mykey')
# Copy the key onto itself, preserving the ACL but changing the content-type
key.copy(key.bucket, key.name, preserve_acl=True, metadata={'Content-Type': 'text/plain'})
key = bucket.lookup('mykey')
[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
@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
@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.

@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"} }