View gist:6ca6d48a90c4aca1c5596d379001c116
async function getGithubUser(username) { // promise + await keyword usage allowed
try { // We handle async function errors with try / catch
const response = await fetch(`https://api.github.com/users/${username}`); // Execution stops here until fetch promise is fulfilled.
const user = response.json();
return user; // equivalent of resolving the getGithubUser promise with user value.
} catch (err) {
throw new Error(err); // equivalent of rejecting getGithubUser promise with err value.
}
}
View test
/biz/steve-canning-photography/577f0d12fdf47583.html
View SassMeister-input.scss
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
//Width
@each $index, $width in (1: 15%, 2: 30%, 4: 45%) {
.collage-width-#{$index} {
width: $width;
overflow: hidden;
View SassMeister-input.scss
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
// Width
@each $index, $width in (1: 15%, 2: 30%, 4: 45%) {
.collage-width-#{$index} {
width: $width;
View gist:001bfbcfe0557ec1bd8c
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
View gist:084c3ff32653783b5d40
[alias]
co = checkout
a = add
s = show
st = status
d = diff
ds = diff --staged
ci = commit
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
View gist:462e4d3f6487d542d9cd
##Based on: https://gist.github.com/871284e41058014863e0
MAGENTA="\033[1;31m"
ORANGE="\033[1;33m"
GREEN="\033[1;32m"
PURPLE="\033[1;35m"
WHITE="\033[1;37m"
BOLD=""
RESET="\033[m"
parse_git_dirty () {
View retina@2x_2x
for filename in *@2x*; do mv "$filename" "${filename//@2x/_2x}"; done
View LocationCalendarDayHours.rb
# Why I get stack level too deep in IRB, when calling:
# location = VendorLocation.find 53575
# LocationCalendarDayHours.from_java_json(location.calendarHours).first.weekday_type_code
#
# Note: I created weekday_type.rb as a WwConstant
class LocationCalendarDayHours
include ActiveModel::Model
include WWLegacyJavaJsonSupport