Commit Empty Directory Git
The most common and widely accepted method is to create a file named .gitkeep inside the empty directory:
mkdir your-directory
cd your-directory
touch .gitkeep
git add .
git commit -m "Add empty directory with .gitkeep"| # includes = preload | |
| > User.includes(:merchants) | |
| User Load (0.7ms) SELECT "users".* FROM "users" | |
| HABTM_Merchants Load (0.9ms) SELECT "merchants_users".* FROM "merchants_users" WHERE "merchants_users"."user_id" IN (3, 1, 2) | |
| Merchant Load (0.7ms) SELECT "merchants".* FROM "merchants" WHERE "merchants"."id" IN (2, 118, 1, 5) | |
| > User.preload(:merchants) | |
| User Load (0.8ms) SELECT "users".* FROM "users" | |
| HABTM_Merchants Load (0.8ms) SELECT "merchants_users".* FROM "merchants_users" WHERE "merchants_users"."user_id" IN (3, 1, 2) |
| #!/bin/sh | |
| tar -xvf jdk-8* | |
| sudo mkdir /usr/lib/jvm | |
| sudo mv ./jdk1.8* /usr/lib/jvm/jdk1.8.0 | |
| sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0/bin/java" 1 | |
| sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0/bin/javac" 1 | |
| sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0/bin/javaws" 1 | |
| sudo chmod a+x /usr/bin/java | |
| sudo chmod a+x /usr/bin/javac |
| # Singleton with ThreadSafe::Cache | |
| require 'thread_safe' | |
| module ActiveSupport | |
| module Inflector | |
| extend self | |
| # A singleton instance of this class is yielded by Inflector.inflections, | |
| # which can then be used to specify additional inflection rules. If passed |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.opentravel.org/OTA/2003/05" targetNamespace="http://www.opentravel.org/OTA/2003/05" elementFormDefault="qualified" version="1.008" id="OTA2007A"> | |
| <xs:include schemaLocation="OTA_VehicleCommonTypes.xsd"/> | |
| <xs:annotation> | |
| <xs:documentation xml:lang="en">All Schema files in the OTA specification are made available according to the terms defined by the OTA License Agreement at http://www.opentravel.org/ota_downloads_form.cfm</xs:documentation> | |
| </xs:annotation> |
| require 'ostruct' | |
| # DeepStruct with some Array support | |
| class DeepStruct < OpenStruct | |
| def initialize(hash = nil) | |
| @table = {} | |
| @hash_table = {} | |
| if hash && hash.is_a?(Hash) | |
| hash.each do |k,v| |
| # gzipped json-stored hash unpack | |
| require 'zlib' | |
| data = Zlib::GzipReader.open("i18n.json.gz") {|gz| gz.read} | |
| h = JSON.parse(data) | |
| # rails console | |
| ActiveRecord::Base.logger = Logger.new(STDOUT) | |
| # one-line Postgres EXPLAIN (ANALYZE) | |
| puts ActiveRecord::Base.connection.execute(%Q{ EXPLAIN (ANALYZE) SELECT ...; }).map{|x| x['QUERY PLAN']}.unshift('').join("\n") |
| # Location names mapper | |
| require 'json' | |
| require 'csv' | |
| # [0] "Location ID", | |
| # [1] "Location Code", | |
| # [2] "IATA", | |
| # [3] "Location", | |
| # [4] "City", |
| # misc options | |
| netstat -tnap | grep LIST | |
| htop | |
| iotop | |
| ssh -f -N -L 9379:127.0.0.1:6379 {remote_user}@{remote_host} -p 22222 | |
| docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock dockerui/dockerui | |
| docker unpause dockerui/dockerui | |
| docker ps |