most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
#!/usr/bin/env ruby | |
require 'spreadsheet' | |
# Begin Test | |
print "Spreadsheet Test\n" | |
# Create the rows to be inserted | |
row_1 = ['A1', 'B1'] | |
row_2 = ['A2', 'B2'] |
# | |
# freezing DateTime.now | |
# | |
# in Rails | |
$ rails c | |
Loading development environment (Rails 3.2.8) | |
# DateTime and Time have milliseconds before freezing time | |
>> DateTime.now.iso8601 9 |
-- | |
-- Name: c_posts_voted(); Type: FUNCTION; Schema: public; Owner: - | |
-- | |
CREATE FUNCTION c_posts_voted() RETURNS trigger | |
LANGUAGE plpgsql | |
AS $$ BEGIN | |
UPDATE "posts" SET voted_user_ids = array_append(voted_user_ids, NEW.user_id) WHERE "id" = NEW.post_id; | |
RETURN NEW; | |
END; |
require 'bundler/setup' | |
require 'lotus/model' | |
require 'lotus/model/adapters/sql_adapter' | |
require 'sqlite3' | |
connection_uri = "sqlite://#{ __dir__ }/test.db" | |
database = Sequel.connect(connection_uri) | |
database.create_table! :articles do | |
primary_key :id |
The process starts by creating the CSR and the private key:
openssl req -nodes -newkey rsa:2048 -nodes -keyout dotmarks.net.key -out dotmarks.net.csr -subj "/C=GB/ST=London/L=London/O=dotmarks/OU=IT/CN=dotmarks.net"
Generates
source 'https://rubygems.org' | |
BUNDLE_RAILS_VERSION = '~> 4.2.4' | |
# Rails | |
gem 'railties', BUNDLE_RAILS_VERSION | |
gem 'activesupport', BUNDLE_RAILS_VERSION | |
gem 'actionpack', BUNDLE_RAILS_VERSION | |
gem 'actionmailer', BUNDLE_RAILS_VERSION | |
gem 'activejob', BUNDLE_RAILS_VERSION |
A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.
Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.