I hereby claim:
- I am plukevdh on github.
- I am plukevdh (https://keybase.io/plukevdh) on keybase.
- I have a public key ASAUM0TdYG6iD3RQxK29SEzkPqj18SAcJszaiNe1uZVCzQo
To claim this, I am signing this object:
import R from 'ramda' | |
const isObject = R.compose(R.equals('Object'), R.type); | |
const allAreObjects = R.compose(R.all(isObject), R.values); | |
const hasLeft = R.has('left'); | |
const hasRight = R.has('right'); | |
const hasBoth = R.both(hasLeft, hasRight); | |
const isEqual = R.both(hasBoth, R.compose(R.apply(R.equals), R.values)); | |
const markAdded = R.compose(R.append(undefined), R.values); |
TL;DR: jQuery <=> rails.js <=> Rails is a strange beast. | |
Breakdown: | |
Rails expects a format to translate a request into a response. This could be | |
HTML, JSON, Script (js request), etc. Usually a straight GET/POST/etc. translates | |
to HTML. Ajax requests translate to a Script request. An odd thing starts happening | |
when you start playing with the request type params (or acceptance headers). Rails | |
has some behind-the-scenes defaults of how it translates requests to response formats | |
when not specified or if the specified does not exists. This gets confusing the more | |
response handlers you add. |
require 'httparty' | |
require 'twilio' | |
module Twimlet | |
module HoldMusic | |
include HTTParty | |
AWS_URL = "s3.amazonaws.com" | |
def generate_playlist(bukkit='com.twilio.music.classical', options={}) | |
@bucket = "http://#{bukkit}.#{AWS_URL}" |
require 'aws-sdk' | |
Aws.config.update({ | |
region: "us-east-1", | |
credentials: Aws::SharedCredentials.new(profile_name: "...") | |
}) | |
PRESET_ID = "..." | |
PIPELINE_ID = "..." |
I hereby claim:
To claim this, I am signing this object:
def envs = [ | |
[env: "stage", region: "us-east-1"] | |
] | |
stage("Plan") { | |
def planJobs = [:] | |
for(int i = 0; i < envs.size(); i++) { | |
def details = envs.get(i) |
// Example envs, could be one of the following | |
def defaultEnvs = [ | |
[env: "stage", region: "us-east-1"], | |
[env: "prod", region: "us-east-1"] | |
] | |
// Or | |
def defaultEnvs = [ |
defmodule Levenshtein do | |
def first_letter_check(one_letter, two_letter) do | |
case one_letter == two_letter do | |
true -> 0 | |
false -> 1 | |
end | |
end | |
def distance(string_1, string_1), do: 0 | |
def distance(string, ''), do: :string.len(string) |
RSpec.configure do |config| | |
config.include InputExampleGroup, type: :input, example_group: { | |
file_path: config.escaped_path(%w[spec inputs]) | |
} | |
end |
const isObject = R.compose(R.equals('Object'), R.type); | |
const isScalar = R.compose(R.not, R.either(isObject, R.isArrayLike), R.last, R.values); |