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
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "shift+h", | |
"command": "workbench.action.focusLeftGroup", | |
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'" | |
}, | |
{ | |
"key": "shift+l", | |
"command": "workbench.action.focusRightGroup", |
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
<template> | |
<div> | |
<p>This is the start of the App component.</p> | |
<Images /> | |
</div> | |
</template> | |
<script> | |
import Images from './components/Images.vue' |
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
{ | |
"basics": { | |
"name": "Matt Royer", | |
"label": "Software Engineer", | |
"email": "matthew.royer@gmail.com", | |
"summary": "My favorite projects to work on are where I can automate a manual process. I have been lucky enough to work on a number of these over the years, including a system that automatically captioned video evidence of Selenium test scenarios, and scrapers that pull and transform data from various websites and APIs. Code is all about the adventure to me.", | |
"location": { | |
"city": "Lehi", | |
"countryCode": "US", | |
"region": "Utah" |
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
PS1="\n\[\033[35m\]\$(/bin/date)\n\[\033[32m\]\w\n\[\033[1;31m\]\u@\h: \[\033[1;36m\]\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files \[\033[1;33m\]\$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')b\[\033[0m\]: \[\033[0m\]" |
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
require 'json' | |
action, name, path = ARGV | |
filename = ".dropp" | |
$config = File.exist?("#{ENV['USERPROFILE']}/#{filename}") ? JSON.parse(File.read("#{ENV['USERPROFILE']}/#{filename}")) : {} | |
def truncate(string, max=65) | |
string.length > max ? "#{string[0...max]}..." : string |
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
$: (Dollar Colon) is basically a shorthand version of $LOAD_PATH. $: contains an array of paths that your script will search through when using require. | |
$0 (Dollar Zero) contains the name of the ruby program being run. This is typically the script name. | |
$* (Dollar Splat) is basically shorthand for ARGV. $* contains the command line arguments that were passed to the script. | |
$? (Dollar Question Mark) returns the exit status of the last child process to finish. | |
$$ (Dollar Dollar) returns the process number of the program currently being ran. | |
$~ (Dollar Tilde) contains the MatchData from the previous successful pattern match. | |
$1, $2, $3, $4 etc represent the content of the previous successful pattern match. | |
$& (Dollar Ampersand) contains the matched string from the previous successful pattern match. | |
$+ (Dollar Plus) contains the last match from the previous successful pattern match. | |
$` (Dollar Backtick) contains the string before the actual matched string of the previous successful pattern match. |
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
def start_of_next_week(date) | |
date + (7 - date.wday) | |
end | |
def date_of_next(day) | |
date = Date.parse(day) | |
delta = date > Date.today ? 0 : 7 | |
date + delta | |
end |
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 times = $(".lecture__item").not('.completed').find('.lecture__item__link__time').map(function() { return $(this).text() }); | |
var reduced_time = times.map(function() { return this.split(":").map(function(str) { return parseInt(str) }).reduce(function(a, b) { return a * 60 + b}) }); | |
var seconds = Array.from(reduced_time).reduce(function(a, b) { return a + b }, 0); | |
Number.prototype.toHHMMSS = function () { | |
var sec_num = parseInt(this, 10); // don't forget the second param | |
var hours = Math.floor(sec_num / 3600); | |
var minutes = Math.floor((sec_num - (hours * 3600)) / 60); | |
var seconds = sec_num - (hours * 3600) - (minutes * 60); |
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
families = [["Jenny", "Dana", "Tana", "Shawn", "Mark"], ["Kevin", "Jamison", "Brian", "Alice"], ["Chris", "John", "April"], ["Kevin", "Jim", "Bobby", "Ryan"]] | |
surnames = ['Richards', 'Millhouse', 'Carmichael', 'Williams'] | |
for index, name in enumerate(surnames): | |
families[index] = list(map(lambda x: "%s %s" % (x, name), families[index])) | |
for family in families: | |
print(family) | |
#=> ['Jenny Richards', 'Dana Richards', 'Tana Richards', 'Shawn Richards', 'Mark Richards'] |
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 urllib | |
import json | |
github = urllib.urlopen('https://api.github.com/repos/google/acai') | |
body = github.read() | |
github.close() | |
json_data = json.loads(body) | |
print json_data |
NewerOlder