This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# License: Public domain | |
# Depends on https://github.com/nonspecialist/pyraven being installed and accessible at `raven` | |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'mqtt' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Document, { Head, Main, NextScript } from 'next/document' | |
import { renderToString } from 'react-dom/server' | |
import { extractCritical } from 'emotion-server' | |
import { ServerStyleSheet } from 'styled-components' | |
import flush from 'styled-jsx/server' | |
export default class MyDocument extends Document { | |
static async getInitialProps(ctx) { | |
const styledComponentsSheet = new ServerStyleSheet() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Document, { Head, Main, NextScript } from 'next/document' | |
import { ServerStyleSheet } from 'styled-components' | |
import { renderToString } from 'react-dom/server' | |
import { extractCritical } from 'emotion-server' | |
export default class MyDocument extends Document { | |
static async getInitialProps(ctx) { | |
const sheet = new ServerStyleSheet(); | |
const originalRenderPage = ctx.renderPage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -e /dev/nvme1n1 ] | |
then | |
sudo /etc/init.d/docker stop | |
sudo mkfs.ext4 /dev/nvme1n1 | |
sudo mount /dev/nvme1n1 /var/lib/docker | |
sudo /etc/init.d/docker start | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GoInteractive | |
def self.start(*args, **kwargs) | |
@init ||= begin | |
Pry.hooks.add_hook(:before_eval, "go_interactive") do |code, pry| | |
current.before_eval(code, pry) | |
end | |
Pry.hooks.add_hook(:after_eval, "go_interactive") do |result, pry| | |
current.after_eval(result, pry) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var filter = vis.append("defs") | |
.append("filter") | |
.attr("id", "stroke") | |
filter | |
.append("feFlood") | |
.attr("flood-color", "blue") | |
.attr("result", "strokeColor") |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"speed": 0.0090636899694800377, | |
"x": -507, | |
"y": 307, | |
"time": 1500542785486, | |
"gpsHoriAcc": 10, | |
"z": 858, | |
"lat": -37.779849772376735, | |
"gpsHeading": 152.9296875, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/apcera/nats" | |
"runtime" | |
"sync/atomic" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'celluloid/io' | |
require 'socket' | |
class Server | |
include Celluloid::IO | |
def run | |
@tcp = TCPServer.new('0.0.0.0', 31337) | |
loop do | |
Connection.new_link(@tcp.accept).async.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RequiredKeywordArguments | |
def required!(name) | |
backtrace = caller_locations(1).map { |c| c.to_s } | |
ex = ArgumentError.new("Missing required keyword argument '#{name}'") | |
ex.set_backtrace(backtrace) | |
raise ex | |
end | |
end | |
class Foo |
NewerOlder