Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
# these are reconstructed from a shell session without runnig them, so make | |
# sure you check that it's a sane thing to do before running it, I make no | |
# guarantees of fitness, and accept no liability. Run at your own risk. | |
sudo launchctl remove com.snap.SnapCameraRemover | |
rm -r ~/Library/Caches/Snap/ | |
rm -r ~/Library/Caches/com.snap.SnapCamera/ | |
rm -r ~/Library/Preferences/Snap/ | |
rm ~/Library/Preferences/com.snap.SnapCamera.plist | |
rm ~/Library/Preferences/com.snap.Snap\ Camera.plist | |
sudo rm -rf /Applications/Snap\ Camera.app/ |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
require "active_record" | |
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") | |
ActiveRecord::Migration.class_eval do | |
create_table(:records) do |t| | |
t.string :column | |
end | |
end | |
data = 50_000.times.map { |i| Hash[column: "Column #{i}"] } |
This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages
branch using Travis CI.
This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.
Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.
To create a clean gh-pages
branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md
in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th
var OFF = 0, WARN = 1, ERROR = 2; | |
module.exports = exports = { | |
"env": { | |
"es6": true | |
}, | |
"ecmaFeatures": { | |
// env=es6 doesn't include modules, which we are using | |
"modules": true |
module ImagesHelper | |
# Acts as a thin wrapper for image_tag and generates an srcset attribute for regular image tags | |
# for usage with responsive images polyfills like picturefill.js, supports asset pipeline path helpers. | |
# | |
# image_set_tag 'pic_1980.jpg', { 'pic_640.jpg' => '640w', 'pic_1024.jpg' => '1024w', 'pic_1980.jpg' => '1980w' }, sizes: '100vw', class: 'my-image' | |
# | |
# => <img src="/assets/ants_1980.jpg" srcset="/assets/pic_640.jpg 640w, /assets/pic_1024.jpg 1024w, /assets/pic_1980.jpg 1980w" sizes="100vw" class="my-image"> | |
# | |
def image_set_tag(source, srcset = {}, options = {}) | |
srcset = srcset.map { |src, size| "#{path_to_image(src)} #{size}" }.join(', ') |
/* app/controllers/index.js */ | |
module.exports.index = function(req, res) { | |
res.render('index.html'); | |
}; |
#!/bin/sh | |
# This script automatically sets the version and short version string of an | |
# Xcode project from the Git repository containing the project. | |
# | |
# To use this script in Xcode 4, add the contents to a "Run Script" build | |
# phase for your application target. | |
set -o errexit | |
set -o nounset |