Reverse all characters in a string.
'Bob Ate Fresh Gummy Karate Monkeys' => 'syeknoM etaraK ymmuG hserF etA boB'
Reverse only the order of words in a string.
'Bob Ate Fresh Gummy Karate Monkeys' => 'Monkeys Karate Gummy Fresh Ate Bob'
@use 'sass:map'; | |
$spacers: ( | |
0: 0, | |
1: 0.25rem, | |
2: 0.5rem, | |
3: 1rem, | |
4: 1.5rem, | |
5: 2.75rem, | |
6: 3rem, |
@use 'sass:map'; | |
$spacers: ( | |
0: 0, | |
1: 0.25rem, | |
2: 0.5rem, | |
3: 1rem, | |
4: 1.5rem, | |
5: 2.75rem, | |
6: 3rem, |
/** | |
* Recursively walk HttpResponse object to cast ISO 8601-formatted dates as | |
* Moment.js objects. | |
* | |
* @see https://git.io/fNzJw | |
* @see https://www.npmjs.com/package/is-iso-date | |
* @see https://www.npmjs.com/package/traverse | |
*/ | |
import { Injectable } from '@angular/core'; |
# vim: set ft=yaml: | |
# @see https://gist.github.com/sealocal/0cd468ba4f12cdada436aebe534b40da | |
--- | |
files: | |
'/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn_install.sh': | |
mode: '000775' | |
owner: root | |
group: users | |
content: | | |
#!/bin/bash |
# Add given object to self's liked objects. | |
# | |
# @example | |
# | |
# @user.like Post.first | |
# @user.public_send('liked_posts') << Post.first | |
# @uuse.liked_posts << Post.first | |
# | |
# @param obj [ApplicationRecord::Likeable] Any likeable record. |
#!/usr/bin/env bash | |
# | |
# Sort automatically-uploaded Dropbox photographs and videos into correct | |
# folders after removing crud like gifs and screenshots: | |
# | |
# 1. A dated folder (e.g. 1970-01-01 for an image taken on January, 1970) for | |
# non-square (non-Instagram) images. | |
# 2. My dump folder for square Instagram images. | |
# | |
# Blame Mark (mark@bhalash.com) for this. |
Someone recently asked the following question in the discussion forum of the Rubyists LinkedIn group: What separates a junior Rails developer from a senior one?
My response follows. Join us at http://www.linkedin.com/groups?gid=120725 to weigh in on this and other topics of interest to Rubyists. As of today there are almost 1,200 members, including numerous movers and shakers in the Ruby and Rails communities.
Distinguishing between junior and senior people in the Rails world is not so different from making the distinction in other web development environments.
Junior Rails people have not dealt with scaling issues to the degree that senior people have. Getting a public-facing Rails application to perform under significant stress is more challenging than doing the same with other building materials such as PHP. Senior people know how to performance-test Rails applications, where to look for bottlenecks, and how to eliminate them one after another until performance is acceptable in real conditions
const seconds = days => parseFloat(days) * 86400; | |
const milliseconds = seconds => parseFloat(seconds) * 1000; | |
const binary = milliseconds => (milliseconds >> 0).toString(2); | |
function compose(a, b) { | |
return function(c) { | |
return b(a(c)); | |
} | |
} |
var doublers = [ | |
n => n * 2, | |
n => n + n, | |
n => n << 1 | |
]; | |
var double = n => _.sample(doublers)(n), | |
verifyDoubling = (n, x) => n * 2 === x; | |
var a = []; |