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
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return; | |
echo "["${ref#refs/heads/}"]" | |
} | |
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' |
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
//Convert the 128x128 image with: | |
// convert image.jpg image.rgb | |
res=128 | |
img_file = File.open(ARGV[0],'r') | |
puts "static char image[#{res*res}] = { " | |
img_file.bytes.each_slice(res) do |l| | |
puts " #{l.join(',')}" | |
end |
NewerOlder