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
| ruby --dump version | |
| ruby --dump copyright | |
| ruby --dump usage #?? | |
| ruby --dump yydebug file.rb | |
| ruby --dump syntax file.rb | |
| ruby --dump parsetree file.rb | |
| ruby --dump parsetree_with_comment file.rb |
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
| # FIND: | |
| find . -type f -name "*.rb" | while read filename; do if [ "0" -ne "`expr length "\`ruby --dump insns $filename | tail -n +2 | tr -d "\n " | grep -oue "^0000putnil([^)])[^l]*leave$"\`"`" ]; then echo $filename; fi; done | |
| # REMOVE: | |
| find . -type f -name "*.rb" | while read filename; do if [ "0" -ne "`expr length "\`ruby --dump insns $filename | tail -n +2 | tr -d "\n " | grep -oue "^0000putnil([^)])[^l]*leave$"\`"`" ]; then echo $filename; fi; done | xargs rm |
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
| #!/bin/sh | |
| sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable | |
| sudo apt-get update | |
| sudo apt-get install nemo nemo-fileroller | |
| xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search | |
| # gsettings set org.gnome.desktop.background show-desktop-icons false | |
| # gsettings set org.nemo.desktop show-desktop-icons true | |
| # I had weird desktop rendering effects after changing desktop icon settings like that. |
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
| find ./db/migrate/* | xargs sed -i 's/create_table [^ ]*/&, :options => "ENGINE=MEMORY"/' |
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
| tokens = [/^:61/, /^:62F:/] | |
| mt940 = <<MT940 | |
| :20:951110 | |
| :25:45050050/76198810 | |
| :28:27/01 | |
| :60F:C951016DEM84349,74 | |
| :61:951017D6800,NCHK16703074 | |
| :86:999PN5477SCHECK-NR. 0000016703074 | |
| :61:951017D620,3NSTON |
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
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| require 'yaml' | |
| require 'active_support/hash_with_indifferent_access' | |
| class Hash | |
| def self.new_from_hash_copying_default(hash) | |
| hash = hash.to_hash | |
| new(hash).tap do |new_hash| |
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
| #define file extensions that should be regarded | |
| EXT=(css ejs erb gemspec gitignore html js json md mustache rake rb rdoc rspec ru scss sh sql txt ui xml xsd yardopts yml) | |
| EXT=$(printf "\|%s" "${EXT[@]}") | |
| EXT=${EXT:2} | |
| # git: | |
| git ls-files "*.*" | grep "\.\($EXT\)$" | sed "s/^/\'/; s/$/\'/;" | xargs sed -i -e '$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
| # plain | |
| find . -name '*.*' | sed 's/.*\.//' | sort -u | tr "\n" " " | |
| # git | |
| git ls-files "*.*" | sed 's/.*\.//' | sort -u | tr "\n" " " | |
| # Explained | |
| # find . -name '*.*' # List all files containing a '.' | |
| # git ls-files "*.*" # List all tracked files containing 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
| inputs=($(xinput --list --id-only | sort -hr | tr "\n" " ")) | |
| for i in "${inputs[@]}"; do | |
| echo $i | |
| xinput --disable $i | |
| done | |
| sleep 10 | |
| for i in "${inputs[@]}"; do xinput --enable $i; done |