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
#!/bin/bash | |
# | |
# Script to be run on new project setup. Run with `bin/setup`. Does the following: | |
# | |
# * Installs ENV and key files from 1Password (does not overwrite existing) | |
# * Runs bundle install, yarn install | |
# * Sets project environment to 'staging' | |
downloadFile() { | |
if [ -e $1 ] |
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
gem "omniauth" | |
gem "omniauth-google-oauth2" |
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
package com.abc.model; | |
import java.util.List; | |
public class Email { | |
private String from; | |
private List<String> to; | |
private List<String> cc; | |
private List<String> bcc; |
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 os | |
import sys | |
# constants, configure to match your environment | |
HOST = 'http://localhost:9200' | |
INDEX = 'test' | |
TYPE = 'attachment' | |
TMP_FILE_NAME = 'tmp.json' | |
# for supported formats, see apache tika - http://tika.apache.org/1.4/formats.html | |
INDEX_FILE_TYPES = ['html','pdf', 'doc', 'docx', 'xls', 'xlsx', 'xml'] |
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
// wrapper around axios for ajax functionality | |
// sets globals when fetching content to help with Rspec wait_for_ajax | |
// adapted from: https://gist.github.com/sheharyarn/7f43ef98c5363a34652e60259370d2cb | |
import axios from 'axios' | |
export const request = (options) => { | |
const onSuccess = (response) => { | |
popAjax() | |
window.current_ajax_request = null // for rspec wait_for_ajax |
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
.pokemons { | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); | |
grid-column-gap: 1em; | |
grid-row-gap: 1em; | |
max-width: 700px; | |
margin: 0 auto; | |
} | |
.poke { |
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 attach_file(url) | |
with_downloaded_file(url) do |file| | |
my_model.attach(io: file, filename: "filename.jpg") | |
end | |
end | |
# this example requires the 'httparty' gem | |
def with_downloaded_file(url) | |
file = Tempfile.new | |
file.binmode |
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
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/node:10.11.0 | |
steps: | |
- checkout | |
- restore_cache: | |
key: dependency-cache-{{ checksum "yarn.lock" }} | |
- run: |
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 EmblemToHbs | |
def convert | |
Dir.glob("**/*.emblem").each do |file| | |
convert_file(file) | |
end | |
end | |
def convert_file(file) | |
`emblem2hbs #{file}` | |
File.delete(file) |
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 { times, upperFirst } from 'lodash'; | |
type GeneratorFnOptions = { | |
sequence: number; | |
}; | |
type GeneratorFn<T> = (opts: GeneratorFnOptions) => T; | |
type GeneratorsMap = { | |
[key: string]: GeneratorFn<any>; | |
}; |
NewerOlder