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 | |
| alias js-eval="osascript -l JavaScript -e" | |
| # examples: | |
| js-eval "1+1" | |
| # 2 | |
| js-eval "Math.PI" |
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
| sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop | |
| sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start |
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
| require 'rubygems/package' | |
| filenames_and_contents = { | |
| "filename" => "content", | |
| } | |
| File.open("archive.tar.gz", "wb") do |file| | |
| Zlib::GzipWriter.wrap(file) do |gzip| | |
| Gem::Package::TarWriter.new(gzip) do |tar| | |
| filenames_and_contents.each_pair do |filename, content| |
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
| var me = Application.currentApplication(); me.includeStandardAdditions = true | |
| ObjC.import('Cocoa') | |
| ObjC.registerSubclass({ | |
| name: 'MainController', | |
| methods: { | |
| 'appDidLaunch:': { | |
| types: ['void', ['id']], | |
| implementation: function(notification) { |
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
| Vagrant.configure("2") do |config| | |
| config.vm.box = "macinbox" | |
| config.vm.provision "shell", | |
| inline: <<~EOF | |
| scutil --set ComputerName macinbox-dev | |
| scutil --set LocalHostName macinbox-dev | |
| defaults write /Library/Preferences/com.apple.screensaver.plist loginWindowIdleTime -integer 0 | |
| pmset -b sleep 0 | |
| EOF | |
| config.vm.provision "shell", privileged: false, |
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 -e | |
| INSTALLER_APP="$1" | |
| OUTPUT_PATH="$2" | |
| DISK_SIZE=${DISK_SIZE:-64} | |
| USER_NAME=${USER_NAME:-vagrant} | |
| FULL_NAME=${FULL_NAME:-$USER_NAME} | |
| PASS_WORD=${PASS_WORD:-$USER_NAME} |
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 -e | |
| INPUT_DIR="$1" | |
| OUTPUT_PATH="$2" | |
| ##### | |
| log_info() { | |
| echo " \033[0;32m-- $*\033[0m" 1>&2 | |
| } |
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
| module.exports = app => { | |
| app.command("/stash", async ({ ack }) => { | |
| await ack("ok"); | |
| }); | |
| }; |
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
| module.exports = app => { | |
| app.command("/stash", async ({ ack, respond, command }) => { | |
| await ack(); | |
| if (command.text) { | |
| await respond(`I heard '${command.text}'`) | |
| } else { | |
| await respond("What?"); | |
| } | |
| }); | |
| }; |
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
| const stash = require("../db").namespace("stash"); | |
| module.exports = app => { | |
| app.command("/stash", async ({ ack, respond, command }) => { | |
| await ack(); | |
| const uniqueId = `${command.team_id}-${command.user_id}`; | |
| if (command.text) { | |
| await stash.set(uniqueId, command.text); | |
| await respond("Your secret is safe with me."); | |
| } else { | |
| const text = (await stash.get(uniqueId)) || "I don't know your secret."; |
OlderNewer