Skip to content

Instantly share code, notes, and snippets.

View 2color's full-sized avatar
🚢

Daniel Norman 2color

🚢
View GitHub Profile
@max-mapper
max-mapper / readme.md
Last active October 12, 2015 10:17
introduction to node
1. Create an etcd token; store it in Vault or some other secure location
2. Create file /etc/systemd/system/docker.service.d/custom.conf with contents:
[Service]
Environment="DOCKER_OPTS=-H=0.0.0.0:2376 -H unix:///var/run/docker.sock --cluster-advertise eth1:2376 --cluster-store etcd://127.0.0.1:2379"
This needs to be done in cloud-init since CoreOS is super bare-bones and "doesn't" contain support for config mgmt out of the box.

Addressing feedback from this Gist.

Pagination. Looks like limited to paginate by id. I wanted to paginate by a date field and felt impossible

In the most recent Preview version, (cursor-)pagination can be done by any unique field or combination of fields. For example:

model Post {
  id        Int     @id @default(autoincrement())
  title     String
@cllunsford
cllunsford / meteor-oauth-client.js
Created May 4, 2012 15:05
Oauth using Meteor and Backbone
var AUTH_URL = "https://api.glitch.com/oauth2/authorize?response_type=code&client_id=000yourclientid000&redirect_uri=http://yoursitehere/oauth/&scope=identity";
var Auth_Router = Backbone.Router.extend({
routes: {
"": "root",
"oauth/?code=:code": "auth"
},
root: function () {},
auth: function (code) {
Meteor.call('authenticate', code, function (error, result) {
@onpaws
onpaws / manifests.yaml
Created May 12, 2019 13:59
Fixed manifests for parity 2.5.0
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: default
name: pv-default-100g-disk01
annotations:
volume.beta.kubernetes.io/storage-class: default
spec:
accessModes:
- ReadWriteOnce
@janeczku
janeczku / vultr-coreos-bootstrap.sh
Last active August 13, 2021 15:14
Cloud-config for CoreOS IPXE deployment on Vultr. Provisioning etcd, fleet, private network and docker compatible firewall. #tags: foo, bar
#!/bin/bash
# Cloud-config for CoreOS IPXE deployment on Vultr
##################################################
# This cloud-config bootstraps CoreOS on /dev/vda and provisions:
# - private ip-address on eth1
# - etcd on private network
# - fleet on private network
# - basic firewall (docker compatible)
# - SSHd security hardening
##################################################
@tj
tj / app.js
Last active October 4, 2021 19:38
const http = require('http')
const rpc = require('./rpc')
/**
* Pets service.
*/
class Pets {
constructor(db = []) {
@gmelodie
gmelodie / gh-get-team-ssh-keys.sh
Created July 4, 2022 18:59
Get SSH keys for all the members of a github team
APITOKEN="" # TODO: add your token here (create one: https://github.com/settings/tokens)
# be sure to check if the token hasn't expired!
# for ORG and TEAM, you can get those by navigating to your team on github
# and seeing the url, which will be in the format:
# https://github.com/orgs/{ORG}/teams/{TEAM}/discussions
# e.g. https://github.com/orgs/application-research/teams/a-team/discussions
@learner-long-life
learner-long-life / Rinkeby.md
Last active August 30, 2022 22:32
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,

@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example: