om man är inne på en server där åäö inte fungerar
lägg till i ~/.profile
# Fix åäö
export LANG=sv_SE.UTF-8
export LANGUAGE=sv:en
export LC_CTYPE=sv_SE.UTF-8
export LC_NUMERIC=sv_SE.UTF-8
export LC_TIME=sv_SE.UTF-8
om man är inne på en server där åäö inte fungerar
lägg till i ~/.profile
# Fix åäö
export LANG=sv_SE.UTF-8
export LANGUAGE=sv:en
export LC_CTYPE=sv_SE.UTF-8
export LC_NUMERIC=sv_SE.UTF-8
export LC_TIME=sv_SE.UTF-8
How a tiny typo in an angular service that got unnoticed, could become a bug several months later
# Typo done in august
.factory("Subtask", function($resource) {
- return $resource("/tasks/:task_id/subtasks/:id", {task_id: "@task_id", id: "@id"});
+ return $resource("tasks/:task_id/subtasks/:id", {task_id: "@task_id", id: "@id"});
}]);
Today I learned that when using a binding.pry
like this inside a Capybara feature test
require "test_helper"
feature "User::CanResetPassword" do
before do
visit reset_password_path
end
scenario "valid email" do
Have you seen the excellent https://istheinternetonfire.com/ website?
They provide a nice dns txt api that I decided to use the give myself an OSX notification whenever they update.
Save the following to a file somewhere in your $PATH
. I chose .bin/istheinternetonfire
#!/usr/bin/env bash
The version below is specifically tailored to handle a model named Item
where the attachment is called image
.
#!/usr/bin/env ruby
require "fileutils"
if File.directory? "public/system/items/images"
puts "Nothing to do, you've already done this"
exit 0
source "https://rubygems.org" | |
gem 'mysql2' | |
gem 'activerecord' | |
gem 'safe_attributes' |
#!/usr/bin/env bash | |
usage() { | |
cat <<EOD | |
Usage: | |
pomodoro [minutes] Start a pomodoro, defaults to 25 minutes | |
EOD | |
} | |
case "$1" in |
ssh deploy@some-server | |
# Upgrade ruby-build (So it knows about the new ruby version and so can fetch it for us) | |
cd ~/.rbenv/plugins/ruby-build | |
git pull | |
# Grab a coffee while downloading ruby | |
rbenv install 2.2.4 | |
# Make sure bundle command is available |
import test from 'ava' | |
import deepFreeze from 'deep-freeze' | |
import omit from 'lodash/omit' | |
test('normal delete will mutate the object', t => { | |
const obj = { a: 1, b: 2 } | |
deepFreeze(obj) | |
t.throws(() => delete obj.a) | |
}) |
Are you having trouble checking out someone's pullrequest from a terminal?
Example usage
git clone git@github.com:example/example.git
ghpr someuser:somebranch # Copy this from the PR
It does these things