start new:
tmux
start new with session name:
tmux new -s myname
| import cyclone.web | |
| import cyclone.auth | |
| from cyclone import escape, httpclient | |
| from cyclone.options import parse_command_line, define, options | |
| from twisted.python import log | |
| from twisted.internet import task, defer, reactor | |
| import sys | |
| try: | |
| import urllib.parse as urllib_parse # py3 |
| #!/bin/bash | |
| # | |
| # Copies certain kinds of known files and directories from a given Jenkins master directory | |
| # into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em. | |
| # | |
| set -ex | |
| if [ $# -ne 2 ]; then | |
| echo usage: $0 root_dir jenkins_master |
| $VERBOSE = nil | |
| require File.expand_path('../rooby', __FILE__) | |
| Person = Rooby::Class.new 'Person' do | |
| define :initialize do |name| | |
| @name = name | |
| end | |
| define :name do |
| source :rubygems | |
| gem 'goliath', '1.0.0' | |
| gem 'rack', '1.4.1' |
| # The following should prevent an ArgumentError "invalid %-encoding (...%)" exception from being raised for malformed URLs. | |
| # To use this code simply drop this in your rails app initializers. | |
| # See: https://github.com/rack/rack/issues/337 | |
| # Taken from: http://stackoverflow.com/a/11162317/1075006 | |
| module URI | |
| major, minor, patch = RUBY_VERSION.split('.').map { |v| v.to_i } |
| # A queue that you can pass to IO.select. | |
| # | |
| # NOT THREAD SAFE: Only one thread should write; only one thread should read. | |
| # | |
| # Purpose: | |
| # Allow easy integration of data-producing threads into event loops. The | |
| # queue will be readable from select's perspective as long as there are | |
| # objects in the queue. | |
| # | |
| # Implementation: |
| rails_root = File.expand_path('../../', __FILE__) | |
| $LOAD_PATH.unshift(rails_root) unless $LOAD_PATH.include?(rails_root) | |
| require 'bundler/setup' | |
| require 'active_record' | |
| require 'rspec/rails/extensions/active_record/base' | |
| require 'spec/support/require_helper' | |
| require 'spec/support/helpers' | |
| require 'ostruct' | |
| Bundler.require :models |
| require 'rubygems' | |
| require "bundler/setup" | |
| require 'eventmachine' | |
| require 'sinatra' | |
| require 'redis' | |
| require 'json' | |
| QUEUESET = 'QUEUESET' # queue index | |
| UUID_SUFFIX = ':UUID' # queue unique id | |
| QUEUE_SUFFIX = ':queue' # suffix to identify each queue's LIST |
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add: