This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def process_file oldfilename | |
markdown_content = textile_to_markdown(File.read(oldfilename)) | |
filename = oldfilename.split("/").last.split(".").first.gsub("-", "_") | |
File.open("doc_src/content/#{filename}.md", "w") do |f| | |
f.write <<-CONTENT | |
--- | |
title: #{filename.capitalize} | |
group: Base | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sed -f textile_to_md.sed original.textile > destination.md | |
s/"\([^"]*\)":\([^\. ]*\.html\)/[\1](\2)/g | |
s/^h3[^.]*\./###/ | |
s/^h4\./####/ | |
s/^h5\./#####/ | |
s/^<js>$/~~~json/ | |
s/^<\/js>$/~~~/ | |
s/^<plain>$/~~~sh/ | |
s/^<\/plain>$/~~~/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
page.driver.network_traffic.map do |req| | |
req.url.gsub(/^(https?:\/\/[^\/]+)\/.*$/, '\1') | |
end.uniq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test1(params) | |
p "test1 #{params}" | |
end | |
def test2(&block) | |
if block_given? | |
p "test2 with block" | |
yield | |
else | |
p "test2 without block" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oldstring="describe" | |
newstring="RSpec.describe" | |
path=path/to/files | |
grep -rl $oldstring $path/* | xargs sed -i '' s/$oldstring/$newstring/g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/docker/docker/issues/8710#issuecomment-72669844 | |
# display IP address isn't boot2docker ip, it's the address from vboxnet0 (run `ifconfig`) | |
brew install socat | |
brew cask install xquartz | |
open -a XQuartz | |
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" | |
# in another window | |
docker run -e DISPLAY=192.168.59.3:0 jess/geary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
acionista | |
acompanhante | |
acordeonista | |
açougueiro | |
acrobata | |
acupunturista | |
adivinho | |
administrador | |
advogado | |
aeromoça |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i '' '/expression/d' ./file* | |
# or, if you have a deep directory tree... | |
find . -name file* -maxdepth 3 -exec sed -i '' '/expression/d' {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
"os" | |
"strconv" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Search available packages with "gimp" in the name or description | |
apt-cache search gimp | |
# Check available versions for package "gimp" | |
apt-cache madison gimp | |
# Check installed and available versions for package "gimp" | |
apt-cache policy gimp | |
# List packages installed via apt |