This file contains 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
Process: accelerate-mandelbrot [51388] | |
Path: /Users/USER/*/accelerate-mandelbrot | |
Identifier: accelerate-mandelbrot | |
Version: 0 | |
Code Type: X86-64 (Native) | |
Parent Process: zsh [45240] | |
Responsible: accelerate-mandelbrot [51388] | |
User ID: 501 | |
Date/Time: 2018-04-29 23:23:46.143 +0900 |
This file contains 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 pickle | |
import numpy | |
import yaml | |
network_file = 'sample_weight.pkl' | |
print("read: %(network_file)s" % locals()) | |
with open(network_file, 'rb') as f: | |
network = pickle.load(f) | |
for key in network.keys(): |
This file contains 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 Control.Monad | |
import Control.Monad.State | |
type CounterState = State Int | |
fivesWithCounter :: CounterState [Int] | |
fivesWithCounter = do | |
modify (+1) | |
fives <- fivesWithCounter | |
i <- get |
This file contains 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 sh | |
brew install coq proof-general | |
ghq get https://github.com/olivierverdier/spacemacs-coq | |
ln -s $(ghq root)/github.com/olivierverdier/spacemacs-coq ~/.emacs.d/private/coq | |
echo "Coq and Proof General are installed." | |
echo "Add `coq' to `dotspacemacs-configuration-layers'. " |
This file contains 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
$chars = [*(0..9).to_a, *('a'..'z').to_a, *('A'..'Z').to_a] | |
$lengths = { | |
username: 14, | |
password: 26, | |
db_name: 14 | |
} | |
def random_chars length | |
length.times.map do | |
$chars.sample |
This file contains 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
sudo yum install -y gcc gcc-c++ git ruby23 ruby23-devel httpd | |
sudo yum install -y nodejs --enablerepo=epel | |
sudo chkconfig httpd on | |
sudo service httpd start | |
sudo chown -R ec2-user:ec2-user /var/www/ | |
sudo alternatives --set ruby /usr/bin/ruby2.3 | |
gem install rake bundler --no-doc |
This file contains 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
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/png "access plus 1 months" | |
ExpiresByType image/jpeg "access plus 1 months" | |
ExpiresByType image/gif "access plus 1 months" | |
ExpiresByType text/css "access plus 1 months" | |
</IfModule> |
This file contains 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
<IfModule mod_deflate.c> | |
SetOutputFilter DEFLATE | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html | |
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|ico)$ no-gzip dont-vary | |
SetEnvIfNoCase Request_URI _\.utxt$ no-gzip |
This file contains 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 :eb do | |
desc 'Dump sql data, through host from eb status or SSH_HOST' | |
task :dump do | |
unless host = ENV['SSH_HOST'] | |
status = `eb status` | |
cname = status.lines.grep(/CNAME:/).first.gsub(/.*CNAME:/, '').strip | |
puts 'host: ' + cname.blue | |
ip = `host #{cname}`.gsub(/.*has address */, '').strip | |
puts 'ip: ' + ip.blue | |
user = 'ec2-user' |
This file contains 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
sudo yum install -y gcc gcc-c++ git ruby23 ruby23-devel httpd | |
sudo yum install -y nodejs --enablerepo=epel | |
sudo chkconfig httpd on | |
sudo service httpd start | |
sudo chown -R ec2-user:ec2-user /var/www/ | |
sudo alternatives --set ruby /usr/bin/ruby2.3 | |
gem install rake bundler --no-doc |
NewerOlder