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("../configure_enzyme"); | |
// | |
// setup a mock for a function that depends on the current system time | |
// | |
import { pastDeadline } from "menu/pastDeadline"; | |
jest.mock("menu/pastDeadline", () => { | |
let areWePastDeadline = true; | |
function __setPastDeadline(newValue) { | |
areWePastDeadline = newValue; |
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 'aws-sdk-s3' | |
namespace :s3 do | |
desc "Download blobs from s3 so can serve from active_storage.service = :local" | |
task :download => :environment do | |
s3 = Aws::S3::Client.new | |
bucket = '<bucket_name>' # TODO: your bucket name here | |
objects = s3.list_objects(bucket: bucket).contents |
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
git diff -z --name-only master | xargs -0 -I FILE_PATH arc lint FILE_PATH | |
# -z delimits files with null character | |
# -0 gobbls the null character | |
# -I ANYTHING declares ANYTHING as the replacement token (to be filled with 1 file name) |
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 | |
# set -x will make bash print/debug commands before it runs them. | |
set -eux -o pipefail | |
echo "yo" | |
exec ls -la ~/Desktop |
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 random | |
alien = Actor('alien') | |
alien.topright = 0, 10 | |
# these pieces of state needed to be attached to an actor to be updated... | |
alien.score = 0 | |
alien.screen_color = 128, 80, 0 | |
bad_alien = Actor('alien') | |
bad_alien.topright = 400, 10 |
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
select | |
date_trunc('day', enqueued_at) as enqueued_at | |
,last_stage | |
,count(*) | |
,round(percentile_cont(0.50) WITHIN GROUP (ORDER BY duration_minutes)) as p50 | |
,round(percentile_cont(0.75) WITHIN GROUP (ORDER BY duration_minutes)) as p75 | |
,round(percentile_cont(0.90) WITHIN GROUP (ORDER BY duration_minutes)) as p90 | |
,round(percentile_cont(0.95) WITHIN GROUP (ORDER BY duration_minutes)) as p95 | |
from queue_stat |
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 pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy as np | |
%matplotlib inline | |
x = np.linspace(0, 10, 100) | |
y = np.cos(x) | |
plt.plot(x,y) | |
grid = np.zeros((20,20)) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>hello world</title> | |
<script> | |
const makeTag = function(src){ | |
let scriptTag = document.createElement('script') | |
scriptTag.src = src | |
return scriptTag |
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 SomeApiController | |
def mutate_data_action | |
new_object = parse_params() | |
save_to_db(new_object) | |
Pusher.broadcast('channel_name', new_object.to_json) | |
end | |
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
# Description: | |
# Allows Hubot to control pandora on a squeezebox music player. | |
# Also plays a generic internet radio station via play. | |
# | |
# Dependencies: | |
# none | |
# | |
# Configuration: | |
# SQUEEZE_BOX_EMAIL (for mysqueezebox.com) | |
# SQUEEZE_BOX_PASSWORD |
NewerOlder