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
on run {input} | |
set the_path to POSIX path of input | |
set cmd to "vim " & quoted form of the_path | |
tell application "System Events" to set terminalIsRunning to exists application process "Terminal" | |
tell application "Terminal" | |
activate | |
if terminalIsRunning is true then | |
do script with command cmd | |
else | |
do script with command cmd in window 1 |
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
// | |
// ViewController.swift | |
// Repnote | |
// | |
// Created by John Neumann on 05/07/2017. | |
// Copyright © 2017 Audioy. All rights reserved. | |
// | |
import UIKit |
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
import Foundation | |
import UIKit | |
extension UIColor{ | |
class var random: UIColor { | |
let hue : CGFloat = CGFloat(arc4random() % 256) / 256 // use 256 to get full range from 0.0 to 1.0 | |
let saturation : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 // from 0.5 to 1.0 to stay away from white | |
let brightness : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 // from 0.5 to 1.0 to stay away from black | |
return UIColor(hue: hue, saturation: saturation, brightness: brightness, alpha: 1) | |
} |
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/bash | |
# | |
# echo "Loading ${HOME}/.bash_profile" | |
#source ~/.profile # get my PATH setup | |
source ~/.bashrc # get my Bash aliases |
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
// | |
// UIScrollViewWithKeyboard.swift | |
// Repnote | |
// | |
// Created by John Neumann on 29/01/2017. | |
// Copyright © 2017 Audioy. All rights reserved. | |
// | |
import UIKit |
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
// | |
// UITextViewWithPlaceholder.swift | |
// Repnote | |
// | |
// Created by John Neumann on 11/01/2017. | |
// Copyright © 2017 Audioy. All rights reserved. | |
// | |
import UIKit |
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
// Remember to #import <CommonCrypto/CommonCrypto.h> in the Bridging-Header.h file | |
/* Example of use | |
let query = "#test1 #test2 #test3" | |
let queryArray = query.characters.split{$0 == "#"}.map(String.init) | |
guard let hash = combineStringsIntoHash(queryArray) else{ | |
return | |
} | |
print("hash: \(hash)") | |
*/ |
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
// HOW TO USE PRIVATE COCOAPODS | |
// SOURCE: http://albertodebortoli.github.io/blog/2014/03/11/cocoapods-working-with-internal-pods/ | |
// SOURCE: https://coderwall.com/p/7ucsva/private-cocoapods | |
// SOURCE: http://product.hubspot.com/blog/architecting-a-large-ios-app-with-cocoapods | |
0. INSTALL COCOAPODS | |
sudo gem install cocoapods | |
1. CHECK REPOS LOCATION, WHICH SHOULD BE EMPTY | |
cd ~/.cocoapods/repos/ |
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
// | |
// Functions.swift | |
// Repnote | |
// | |
// Created by Jonathan Neumann on 23/03/2017. | |
// Copyright © 2017 Audioy. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
NewerOlder