Updated for Rails 4.0.0+
-
Set up the
bower
gem. -
Follow the Bower instructions and list your dependencies in your
bower.json
, e.g.// bower.json
{
#!/usr/bin/env ruby | |
require 'sinatra' | |
# simple script to serve static files from an arbitrary directory via Sinatra | |
# usage: rserve [/path/to/dir] [port] | |
# path will default to '.' | |
pub = File.expand_path(ARGV.shift || '.') | |
puts "Setting Public to #{pub}" |
require 'minitest/autorun' | |
class Minitest::Test | |
def self.test(name, &block) | |
define_method "test_#{name.gsub(/\s+/, '_')}", &block | |
end | |
def self.setup(&block) | |
define_method :setup, &block | |
end |
Updated for Rails 4.0.0+
Set up the bower
gem.
Follow the Bower instructions and list your dependencies in your bower.json
, e.g.
// bower.json
{
Use of figaro gem (or something like dotenv) in all environments.
The Figaro config/application.yml
file with all the secrets will be git-ignored. So on every deployment server I had to manually add the file shared/config/application.yml
and then linked automatically on each deployment to the current version of the app by adding in config/deploy.rb
:
set :linked_files, %w{config/application.yml}
For development config/application.yml
is something like the following:
There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.
All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.
What do these lines do? Make predictions and then scroll down.
func print(pi *int) { fmt.Println(*pi) }
import angular from 'angular'; | |
import MyService from './myService'; | |
import myDirective from './myDirective'; | |
angular.module('myApp', []) | |
.service('myService', MyService) | |
.directive('myDirective', myDirective); |
#!/usr/bin/env python | |
""" | |
Find host - decode hashed known_hosts files | |
Using an unhashed known_hosts file as reference, compare by host | |
key. | |
""" | |
import logging |
EVENT HANDLING
First source file you should be reading when trying to understand React Event System is ReactBrowserEventEmitter.js.
ReactEventListener
First the event is captured at the top-level ReactEventListener
.
API
<style> | |
body { display: flex; align-items: center; justify-content: center; } | |
h1 { font-size: 60px; font-family: Helvetica; } | |
</style> | |
<script type="module"> | |
import { innerHTML, html, use } from 'https://diffhtml.org/master/diffhtml'; | |
import createLogger from 'https://diffhtml.org/master/diffhtml-middleware-logger'; | |
import inlineTransitions from 'https://diffhtml.org/master/diffhtml-middleware-inline-transitions'; |
Here we create the master key. We want only Certify
capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate
capabilities will be assigned to the subkeys.
Run the following command to start the master key generation process. Select the set your own capabilities
creation process (type 8
)
▶ gpg --full-generate-key --expert
gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.