TIL attr_* methods are optomized.
class Whatever
def foo
@foo
end
attr_reader :bar
end| ### | |
| ### | |
| ### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
| ### https://christitus.com/windows-tool/ | |
| ### https://github.com/ChrisTitusTech/winutil | |
| ### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
| ### iwr -useb https://christitus.com/win | iex | |
| ### | |
| ### OR take a look at | |
| ### https://github.com/HotCakeX/Harden-Windows-Security |
TIL attr_* methods are optomized.
class Whatever
def foo
@foo
end
attr_reader :bar
end| require 'csv' | |
| module JekyllCsv | |
| class Generator < Jekyll::Generator | |
| def generate(site) | |
| dir = File.expand_path "_csvs", site.source | |
| return if site.safe && File.symlink?(dir) | |
| entries = Dir.chdir(dir) do | |
| Dir['*.csv'] |
| FROM ubuntu:12.04 | |
| #Install Ruby | |
| RUN apt-get update | |
| RUN DEBIAN_FRONTEND=noninteractive apt-get -y install ruby1.9.1 ruby1.9.1-dev make | |
| #Pygments doesn't seem to want to work regardless of version installed | |
| RUN gem install pygments.rb | |
| #Install Jekyll | |
| RUN gem install jekyll |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| Ruby 2.1.0 in Production: known bugs and patches | |
| Last week, we upgraded the github.com rails app to ruby 2.1.0 in production. | |
| While testing the new build for rollout, we ran into a number of bugs. Most of | |
| these have been fixed on trunk already, but I've documented them below to help | |
| anyone else who might be testing ruby 2.1 in production. | |
| @naruse I think we should backport these patches to the ruby_2_1 branch and | |
| release 2.1.1 sooner rather than later, as some of the bugs are quite critical. | |
| I'm happy to offer any assistance I can to expedite this process. |
WARNING: If you're reading this in 2021 or later, you're likely better served by reading:
(This gist was created in 2013 and targeted the legacy GOPATH mode.)
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |