Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
def call | |
@all_dishes = [] | |
# У нас есть требование чтобы одно блюдо встречалось не более трех раз в неделю | |
# Таким образом получается что нам нужно подобрать 3 рациона на пн, вт, ср | |
# а дальше мы просто повторим их же | |
variants = 3.times.map do | |
# недобор или перебор по конкретным материалам, изначально все в 0 | |
@diff = {} | |
#!/bin/bash | |
export vault=/usr/local/bin/vault | |
export VAULT_TOKEN=$(cat /root/.vault-token) | |
vault_cacert='-ca-cert=/path/to/your/ca.pem' | |
local_vault="-address=https://$(hostname -f):8200" | |
unsealed_vault="-address=https://$(getent hosts $(dig +short vault.service.consul | tail -n 1) | awk '{ print $2 }'):8200" | |
leader_vault="-address=https://$($vault status $vault_cacert $unsealed_vault 2> /dev/null | grep Leader | awk '{ print $2 }' | sed 's/^http\(\|s\):\/\///g'):8200" | |
vault_read="$vault read $vault_cacert $leader_vault" | |
vault_unseal="$vault unseal $vault_cacert $local_vault" |
/* | |
Started with example code written by Nathan Seidle from SparkFun Electronics and added | |
LCD output with gram and ounce values. | |
Setup your scale and start the sketch WITHOUT a weight on the scale | |
Once readings are displayed place the weight on the scale | |
Press +/- or a/z to adjust the calibration_factor until the output readings match the known weight | |
Arduino pin 6 -> HX711 CLK | |
Arduino pin 5 -> HX711 DOUT |
// Promise.all is good for executing many promises at once | |
Promise.all([ | |
promise1, | |
promise2 | |
]); | |
// Promise.resolve is good for wrapping synchronous code | |
Promise.resolve().then(function () { | |
if (somethingIsNotRight()) { | |
throw new Error("I will be rejected asynchronously!"); |
import code; code.interact(local=dict(globals(), **locals())) |
moved to github --> https://github.com/bill-auger/git-branch-status/ |
require 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
describe "GET #index" do | |
#describe "POST #create" do | |
#describe "GET #show" do | |
#describe "PATCH #update" do (or PUT #update) | |
#describe "DELETE #destroy" do | |
#describe "GET #new" do |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'sinatra-contrib', require: 'sinatra/streaming' | |
group :development do | |
gem 'thin' | |
gem 'pry-rails' | |
end |
TodoMVC.module 'TodoApp', (App, TodoMVC, Backbone, Marionette, $, _) -> | |
log arguments | |
class App.TodoForm extends Marionette.ItemView | |
events: | |
'keypress #new-todo' : 'createOnEnter' | |
'click .mark-all-done' : 'toggleAllClicked' | |
triggers: | |
'click .todo-clear a' : 'clear:completed' |