Skip to content

Instantly share code, notes, and snippets.

jonathan-beebe / alasset_to_phasset.swift
Created Jul 18, 2015
Convert ALAsset to iOS8+ PHAsset
View alasset_to_phasset.swift
import Photos
import AVFoundation
func ALAssetToPHAsset(asset:ALAsset) -> PHAsset {
var fetchOptions: PHFetchOptions = PHFetchOptions()
var url:NSURL = asset.valueForProperty(ALAssetPropertyAssetURL) as! NSURL
let fetchResult:PHFetchResult = PHAsset.fetchAssetsWithALAssetURLs([url], options: fetchOptions)
return fetchResult.firstObject as! PHAsset
kellyegan / ViewController.swift
Last active Apr 29, 2019
Send emails with attachments in iOS using Swift
View ViewController.swift
// ViewController.swift
// SendEmailWithAttachment
// Created by Kelly Egan on 3/17/15.
// Copyright (c) 2015 Kelly Egan. All rights reserved.
import UIKit
import MessageUI
blackjid /
Last active May 11, 2020
How configure your raspberry pi with dashing to have a awesome dashboard

Raspberry pi dashboard

This is what we did to setup a few dashboards at platanus

You'll need

  • Raspberry Pi
  • Dashing Service
  • Wifi stick (optional)
Stichoza / fbShare.js
Created Feb 13, 2013
Facebook share popup JS function, popup window in screen center.
View fbShare.js
function fbShare(url, title, descr, image, winWidth, winHeight) {
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);'[title]=' + title + '&p[summary]=' + descr + '&p[url]=' + url + '&p[images][0]=' + image, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
cobyism /
Last active Sep 18, 2020
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

cblunt /
Last active Sep 25, 2015
A simple git cheatsheet for reference.

Quick Summary

cd my_project

git init .
git add . # add everything
git commit -m 'Initial commit'

... make some changes ...

You can’t perform that action at this time.