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
| namespace :tools do | |
| desc 'Clear the database' | |
| task :clear_db => :environment do |t,args| | |
| ActiveRecord::Base.establish_connection | |
| ActiveRecord::Base.connection.tables.each do |table| | |
| next if table == 'schema_migrations' | |
| ActiveRecord::Base.connection.execute("TRUNCATE #{table}") | |
| end | |
| end |
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
| Rails I18n helper |
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
| # | |
| # Bash completion file for Linux Mint apt utility. | |
| # | |
| have apt && | |
| _apt() | |
| { | |
| local cur opt | |
| COMPREPLY=() | |
| cur="${COMP_WORDS[COMP_CWORD]}" |
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/bash | |
| # https://github.com/ryanries/UniversalPauseButton | |
| # https://news.ycombinator.com/item?id=9686854 | |
| currentProcess=$(xprop -id $(xprop -root | grep -F '_NET_ACTIVE_WINDOW(WINDOW)' | awk '{print $5}') | grep -F '_NET_WM_PID(CARDINAL)' | awk '{print $3}') | |
| state=$(grep 'State:' /proc/$currentProcess/status | awk '{print $2}') | |
| if [[ "$state" == "T" ]] | |
| then |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 bash | |
| #!/usr/bin/env sh | |
| sudo update-alternatives --install \ | |
| /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-3.6 200 \ | |
| --slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-3.6 \ | |
| --slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-3.6 \ | |
| --slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-3.6 \ | |
| --slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-3.6 \ |
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 bash | |
| sudo update-alternatives --install \ | |
| /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-3.6 200 \ | |
| --slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-3.6 \ | |
| --slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-3.6 \ | |
| --slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-3.6 \ | |
| --slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-3.6 \ | |
| --slave /usr/bin/llvm-diff llvm-diff /usr/bin/llvm-diff-3.6 \ | |
| --slave /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-3.6 \ |
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
| $ echo "id:${UID}/${SUDO_UID} user:${USER}/${SUDO_USER} home: ${HOME}" | |
| ➡ id:1000/ user:talos/ home: /home/talos | |
| $ sudo bash -c 'echo "id:${UID}/${SUDO_UID} user:${USER}/${SUDO_USER} home: ${HOME}"' | |
| ➡ id:0/1000 user:root/talos home: /home/talos | |
| $ sudo -H bash -c 'echo "id:${UID}/${SUDO_UID} user:${USER}/${SUDO_USER} home: ${HOME}"' | |
| ➡ id:0/1000 user:root/talos home: /root |
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 bash | |
| set -e | |
| function iColor() { | |
| echo -n "'$(tput setaf $1)"; shift; echo -n "${@}$(tput sgr0)'" | |
| } | |
| function print_info() { | |
| function iColor() { | |
| printf "'$(tput setaf $1)"; shift; printf "${@}$(tput sgr0)'" |
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/bash | |
| #Heith Seewald 2012 | |
| #Feel free to extend/modify to meet your needs. | |
| #Maya on Ubuntu v.1 | |
| #This is the base installer... I’ll add more features in later versions. | |
| #if you have any issues, feel free email me at heiths@gmail.com | |
| #### Lets run a few checks to make sure things work as expected. | |
| #Make sure we’re running with root permissions. | |
| if [ `whoami` != root ]; then |