Skip to content

Instantly share code, notes, and snippets.

```
gem uninstall --all --ignore-dependencies --executables
gem install bundler
gem update --system
```
@hieunguyentrung
hieunguyentrung / download_images.rb
Created December 1, 2019 14:35
Download images
```
x = a.scan(/https\:\/\/i.pinimg\.com[\/\d\w]*\.jpg\s2x/)
require 'open-uri'
def download_image(url, dest)
open(url) do |u|
File.open(dest, 'wb') { |f| f.write(u.read) }
end
@hieunguyentrung
hieunguyentrung / random.md
Created November 26, 2019 22:30
Random records
@hieunguyentrung
hieunguyentrung / fileutils conflict.md
Created November 5, 2019 00:47
fileutils conflict
gem uninstall fileutils
gem update fileutils --default
@hieunguyentrung
hieunguyentrung / grape.md
Created October 10, 2019 06:56
Grape useful
params do
  requires :number, type: Integer, values: ->(v) { v.even? && v < 25 }
end

params do
  optional :category
  given category: ->(val) { val == 'foo' } do
    requires :description
 end
@hieunguyentrung
hieunguyentrung / gist:b6a75681140a3bf44714544cfcb2dff5
Created September 8, 2019 09:06
git assume-unchanged vs skip-worktree
git update-index --assume-unchanged FILE_NAME
https://fallengamer.livejournal.com/93321.html
https://stackoverflow.com/questions/13630849/git-difference-between-assume-unchanged-and-skip-worktree#
git assume-unchanged vs skip-worktree
@hieunguyentrung
hieunguyentrung / git.md
Last active September 8, 2019 23:41
Git cheat sheet
@hieunguyentrung
hieunguyentrung / a.slim
Created August 30, 2019 04:16
iframe full screen
iframe src='http://192.168.20.227:8008/' style='position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;%'