adduser deploy
passwd deploy
This file contains 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 camelCaseString(source: String) -> String { | |
if contains(source, " ") { | |
let first = source.substringToIndex(advance(source.startIndex, 1)) | |
let cammel = NSString(format: "%@", (source as NSString).capitalizedString.stringByReplacingOccurrencesOfString(" ", withString: "", options: nil, range: nil)) as String | |
let rest = dropFirst(cammel) | |
return "\(first)\(rest)" | |
} else { | |
let first = (source as NSString).lowercaseString.substringToIndex(advance(source.startIndex, 1)) | |
let rest = dropFirst(source) | |
return "\(first)\(rest)" |
This file contains 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 UIKit | |
class ViewController: UIViewController { | |
@IBOutlet weak var execButton: UIButton! | |
var username: String? = nil | |
var password: String? = nil | |
lazy var conn: NSURLSession = { |
This file contains 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
tell application "System Events" to tell process "Mail" | |
set mainWindow to a reference to the first window | |
set rootSplitter to a reference to the first splitter group of the mainWindow | |
set firstSplitter to a reference to the last splitter group of the rootSplitter | |
set scrollArea to a reference to the last scroll area of the firstSplitter | |
set scrollGroup to a reference to the first group of the scrollArea | |
if number of groups of the scrollGroup is greater than 1 then | |
set maybeRemoteContentGroup to a reference to the first group of the scrollGroup | |
This file contains 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
tell application "Safari" | |
set topWindows to every window whose name is not "" | |
set numWindows to the number of topWindows | |
set didFind to false | |
set targetUrl to "http://localhost:3000/" | |
repeat with x from 1 to numWindows | |
set numTabs to the number of tabs in window x | |
repeat with y from 1 to numTabs | |
set tabUrl to the URL of tab y of window x |
This file contains 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 extend() { | |
var args = [].slice.call(arguments); | |
args[0] = (typeof args[0] === 'object') ? args[0] : {}; | |
for (var i=1; i<args.length; i++) { | |
if (typeof args[i] === 'object') { | |
for (var key in args[i]) { | |
if (args[i].hasOwnProperty(key)) { | |
args[0][key] = args[i][key]; | |
} | |
} |
This file contains 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
class ApiClient | |
attr_accessor :base_url | |
attr_accessor :default_headers | |
attr_accessor :default_params | |
attr_accessor :basic_auth | |
attr_reader :body | |
def initialize(base_url:, headers: {}, params: {}) | |
@base_url = base_url |
This file contains 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
#!/usr/bin/env bash | |
MAX_NUM_BACKUPS=10 | |
DB_LOCATION=/root/dropbox_uploader.sh | |
DB_CONFIG=/root/.dropbox_uploader | |
BACKUP_FILENAME=ss_ranch_bkup | |
BKP_DIRS="/home/docker/rancher /home/docker/nginx" | |
EXCLUDE_DIRS="/home/docker/nginx/ssl" | |
TMP_DIR="/tmp/" |
This file contains 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
var Log = { | |
_levelInt: function levelInt() { | |
return this._levels.indexOf(this.level); | |
}, | |
_intForLevel: function intForLevel(level) { | |
return this._levels.indexOf(level); | |
}, | |
_logForLevel: function logForLevel() { | |
if (!console) { return; } |
NewerOlder