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
sendCode() { | |
const code = this.state.code; | |
const lastRowIndex = this.refs.aceEditor.editor.session.getLength() - 1; | |
const functionBody = code.split('\n').filter((l, i) => { if(!(i == 0 || i == lastRowIndex )){ return l } }).join("\n"); | |
const question = this.state.question; | |
const functionName = question.functionName; | |
const params = question.args.map(q => q.name); | |
const testArgs = question.tests.map(t => t.input); | |
const interpreter = new Worker(); | |
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
// Credit to underscore.js | |
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// N milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { |
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
# See https://github.com/RehanSaeed/EditorConfig for updates to this file. | |
# See http://EditorConfig.org for more information about .editorconfig files. | |
################# | |
# Common Settings | |
################# | |
# This file is the top-most EditorConfig file | |
root = true |
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
# power shell script to use microsoft speech to automate weekly standup | |
Add-Type -AssemblyName System.Speech | |
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer | |
$since = "1 weeks ago" | |
$user = git config user.name | |
$projectPath = "$env:USERPROFILE\Documents\Visual Studio 2017\Projects" | |
$projects = New-Object "System.Collections.Generic.List[String]" | |
$projects.Add("project1") | |
$projects.Add("my_other_project") |
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
// glued a couple stack overflows together | |
function CELLFORMULA(ref) { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var formula = SpreadsheetApp.getActiveRange().getFormula(); | |
var args = formula.match(/=\w+\((.*)\)/i)[1].split('!'); | |
try { | |
if (args.length == 1) { | |
var range = sheet.getRange(args[0]); | |
} |
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
# For Elastic Search version 5.6 | |
# Credit to https://opensourceconnections.com/blog/2016/04/21/run-elasticsearch-in-your-shell/ | |
# This mostly worked, I had to remove the argument for default.path.home and prepend each arg with -E (ES version 5.0+ breaking change) | |
# | |
# Add the following to your path and load (for ubuntu, actual paths may vary) | |
# Elastic Search Settings -- | |
# ES_JAVA_OPTS="-Des.logger.level=INFO" | |
# LOG_DIR="/var/log/elasticsearch" | |
# DATA_DIR="/var/lib/elasticsearch" | |
# CONF_DIR="/etc/elasticsearch" |
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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Listen for XDebug", | |
"type": "php", | |
"request": "launch", |
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 caesar_cypher(word, shift_amount) | |
result = "" | |
word.each_char do |character| | |
letter_value = character.ord | |
if (97..122).include?(letter_value) | |
# shift lowercase letters | |
result += (((letter_value - 97 + shift_amount) % 26) + 97).chr | |
elsif (65..90).include?(letter_value) | |
# shift the uppercase letters |