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_term_bgcolor(){ | |
local R=$1 | |
local G=$2 | |
local B=$3 | |
/usr/bin/osascript <<EOF | |
tell application "iTerm" | |
tell current session of current window | |
set background color to {$(echo "scale=2; ($1/255.0)*65535" | bc),$(echo "scale=2; ($2/255.0)*65535" | bc),$(echo "scale=2; ($3/255.0)*65535" | bc)} | |
end tell | |
end tell |
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 | |
# Ask the user for their name | |
echo 'Hello, I will help you connect to your EC2 instance. | |
You will need 3 pieces of information: | |
Username | |
Host Address | |
Path to key file\n\n' | |
read -n 1 -s -r -p "[Press any key to continue]" |
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 | |
sudo apt-get update | |
sudo apt -y install python-pip | |
sudo -H pip install --upgrade pip | |
sudo apt-get -y install python2.7 python-pip python-dev | |
sudo apt-get -y install ipython ipython-notebook | |
sudo -H pip install jupyter | |
sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list | |
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 |
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 | |
# Ask the user for their name | |
echo 'Hello, I will help you connect to your EC2 instance. | |
You will need 3 pieces of information: | |
Username | |
Host Address | |
Path to key file\n\n' | |
read -n 1 -s -r -p "[Press any key to continue]" |
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
getwd() | |
df <- read.csv("test.csv") |
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
python -c 'import datetime;print "Week: %s" % datetime.date.today().isocalendar()[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
// server.js | |
var express = require("express"); | |
var app = express(); | |
var main = require("./node-main.js") | |
var bodyParser = r equire('body-parser') | |
app.use(bodyParser.json()); // to support JSON-encoded bodies | |
app.use(bodyParser.urlencoded({ // to support URL-encoded bodies | |
extended: true | |
})); |
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
// main.js | |
const rq = require('request-promise'); | |
const electron = require('electron'); | |
const app = electron.app; | |
const BrowserWindow = electron.BrowserWindow; | |
const child = require('child_process') | |
var mainWindow = null; | |
app.on('window-all-closed', function() { |
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
// node-main.js | |
const sqlite3 = require('sqlite3') | |
const util = require('util') | |
const exec = require('child_process').exec | |
class DataGrabber { | |
constructor() { | |
this.OSX_EPOCH = 978307200 | |
this.messages = [] | |
const { exec } = require('child_process'); |
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 os | |
import sys | |
import sqlite3 | |
import datetime | |
USERNAME = os.popen('whoami').read().strip() | |
class DataGrabber(object): | |
"""docstring for ClassName""" | |
def __init__(self): |