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 { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \(\1\)/' | |
} | |
function cli { | |
local BLUE="\[\033[0;34m\]" |
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
# config/initializers/devise.rb | |
require 'devise/models/remote_authenticatable' | |
require 'remote_auth_strategy' | |
Devise.setup do |config| | |
# all the other shenanigans... | |
config.warden do |manager| | |
manager.intercept_401 = false | |
manager.default_strategies(:scope => :user).unshift :remote |
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
${:import(org.slf4j.Logger, org.slf4j.LoggerFactory)} | |
private static final Logger log = LoggerFactory.getLogger(${enclosing_type}.class); |
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
java -XX:+PrintFlagsFinal |
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
# first find the process using top | |
top -H | |
# find the java process | |
top - 15:32:53 up 1 day, 2:20, 1 user, load average: 1.28, 1.17, 1.18 | |
Tasks: 2355 total, 2 running, 2353 sleeping, 0 stopped, 0 zombie | |
Cpu(s): 26.4%us, 1.4%sy, 0.0%ni, 66.1%id, 5.7%wa, 0.0%hi, 0.2%si, 0.2%st | |
Mem: 16332248k total, 9613508k used, 6718740k free, 312148k buffers | |
Swap: 1048572k total, 0k used, 1048572k free, 1858716k cached |
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 . -type f -size +10000k -exec ls -lh {} \; | awk '{ print $0 ": " $5 }' |
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
user = User.find(user_id).skip_confirmation! | |
user.save! |
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
__ _____ | |
___ ___ _____ ___ ___ __ __/ /____ ___ / _/ /__ _____ ________ | |
/ _ `/ // / _ \(_-</ _ \/ // / __(_-</ _ \/ _/ __/ |/|/ / _ `/ __/ -_) | |
\_, /\_,_/_//_/___/\___/\_,_/\__/___/\___/_/ \__/|__,__/\_,_/_/ \__/ | |
/___/ | |
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
$> brew cask install java | |
$> brew install kafka | |
$> vim ~/bin/kafka | |
# ~/bin/kafka | |
#!/bin/bash | |
zkServer start | |
kafka-server-start.sh /usr/local/etc/kafka/server.properties |
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" | |
func main() { | |
for i := 0; i < 100; i++ { | |
m3 := i % 3 == 0 | |
m5 := i % 5 == 0 |
OlderNewer