This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Bundle.swift | |
// timerany | |
// | |
// Created by Leo Dion on 12/2/16. | |
// Copyright © 2016 BrightDigit. All rights reserved. | |
// | |
import Foundation | |
import CoreGraphics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __git_submodule_foreach_commit () { | |
git submodule foreach "git commit -am $1" && git commit -am $1 | |
} | |
function __git_submodule_foreach_push () { | |
git submodule foreach "git push" && git push | |
} | |
function __git_submodule_foreach_pull () { | |
git submodule foreach "git pull" && git pull |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
var base32 = require('base32'); | |
const uuidV4 = require('uuid/v4'); | |
function chunkString(str, length) { | |
return str.match(new RegExp('.{1,' + length + '}', 'g')); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#curl -s http://javascriptweekly.com/issues/$1 | pup '.issue-html table div > a[title] json{}' | jq '.[]' | jq -r '.text + " " + .href' | |
#curl -s http://iosdevweekly.com/issues/$1 | pup 'section .item h3.item__title a json{}' | jq '.[]' | jq -r '.text + " " + .href' | |
#curl -s http://www.echojs.com | pup 'article[data-news-id] a[rel] json{}' | jq '.[]' | jq -r '.text + " " + .href' | |
#curl -s https://swiftnews.curated.co/issues/$1 | pup 'section .item h3.item__title a json{}' | jq '.[]' | jq -r '.text + " " + .href' | |
#curl -s https://swiftnews.curated.co/issues/$1 | pup 'section .item h3.item__title a json{}' | jq '.[]' | jq -r '.text + " " + .href' | |
#curl -s http://ios-goodies.com | pup '.post .body-text li json{}' | jq '.[]' | jq -r '.children[0].text + " by " + .children[1].text + " " + .children[0].href' | |
curl -s https://mobilewebweekly.com/issues/$1 | pup '.issue-html table table table table td > a[title] json{}' | jq '.[]' | jq -r '.text + " http://" + .title' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CaseIterable gives us the allCases properties | |
enum Suit : CaseIterable { | |
case clubs, hearts, diamonds, spades | |
} | |
// CaseIterable gives us the allCases properties | |
enum Rank : CaseIterable { | |
case two, three, four, five, six, seven, eight, nine, ten, jack, queen, king, ace | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate | |
{ | |
... | |
func applicationShouldRequestHealthAuthorization(_ application: UIApplication) { | |
let healthStore = HKHealthStore() | |
healthStore.handleAuthorizationForExtension { | |
(success, error) -> Void in | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func startWorkoutWithHealthStore(_ healthStore: HKHealthStore, | |
andActivityType activityType: HKWorkoutActivityType, | |
withSampleTypes sampleTypes: [HKSampleType]) -> HKWorkoutSession { | |
let configuration = HKWorkoutConfiguration() | |
configuration.activityType = activityType | |
let session : HKWorkoutSession | |
do { | |
session = try HKWorkoutSession(configuration: configuration) | |
} catch let error { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set mol_list to {} | |
-- This will ask you to select a file containing the intended recepients and their emails -- | |
-- I also include in this file information needed to link to an attachment -- | |
set theFile to choose file with prompt "Select a text file:" | |
set theFileReference to open for access theFile | |
-- Note that the line end here is an old Mac return (not MSFT carriage return) -- | |
set theFileContents to read theFileReference using delimiter linefeed | |
close access theFileReference | |
-- Now parse the file that was selected. Here I'm parsing a tab-delimited file. -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FRAMEWORKS_FOLDER_PATH="`dirname $1`/Frameworks/" | |
LIBS=`otool -L "$1" | grep "/opt\|Cellar" | awk -F' ' '{ print $1 }'` | |
for lib in $LIBS; do | |
EXPECTED_PATH="`dirname $1`/Frameworks/`basename $lib`" | |
if [ ! -f $EXPECTED_PATH ]; then | |
IFS='.' read -ra FILENAME_COMPS <<< "`basename $lib`" | |
ACTUAL_PATH=`find $FRAMEWORKS_FOLDER_PATH -name "${FILENAME_COMPS[0]}*.*"` | |
install_name_tool -id @rpath/`basename $ACTUAL_PATH` "`dirname $1`/Frameworks/`basename $ACTUAL_PATH`" |