Skip to content

Instantly share code, notes, and snippets.

Avatar
✂️
Yak Shaving

Tatsuya Itakura itkrt2y

✂️
Yak Shaving
View GitHub Profile
@rmosolgo
rmosolgo / page_example.rb
Created Apr 10, 2019
Generic page number / per-page pagination with GraphQL-Ruby
View page_example.rb
# This is a full-blown offset-based pagination system modelled after GraphQL-Ruby's
# built-in connections. It has a few different elements:
#
# - `::Page`, a plain ol' Ruby class for modeling _pages_ of things.
# This class handles applying pagination arguments to lists (Arrays and AR::Relations)
# and provides metadata about pagination. (Similar to `will_paginate`.)
# - `Schema::BasePage` is a generic GraphQL-Ruby object type. It's never used directly,
# but it can generate subclasses which wrap _specific_ object types in the schema.
# - `Schema::BaseObject.page_type` is a convenience method for generating page types
# from your object types. You could leave this out and make subclasses with plain ol'
@rviscomi
rviscomi / CrashCourseInCrUX.md
Last active May 7, 2019
"Crash Course in CrUX" for the PerfMatters conference, April 2019
View CrashCourseInCrUX.md
@wesbos
wesbos / async-await.js
Created Feb 22, 2017
Simple Async/Await Example
View async-await.js
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
View database.yml
default: &default
adapter: mysql2
encoding: utf8mb4
username: root
password:
host: localhost
variables:
sql_mode: TRADITIONAL,NO_AUTO_VALUE_ON_ZERO,ONLY_FULL_GROUP_BY
development:
@voluntas
voluntas / new_to_mqtt.rst
Last active Nov 21, 2020
初めての MQTT
View new_to_mqtt.rst