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
# Start the VM with `vagrant up` | |
# After everything runs, enter the VM with `vagrant ssh` | |
# The app lives in the `blog` directory | |
# After running `mix deps.get && mix ecto.create`, `mix phoenix.server` should work | |
# The page will be accessible at 192.168.50.4:4000 from the host machine | |
# | |
# Some utility scripts are available in the project directory: | |
# | |
# * break_it.sh: breaks the app by modifying web/controllers/page_controller.ex | |
# * fix_it.sh: undo break_it.sh changes |
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
'use strict'; | |
var async = require('async'); | |
var _ = require('lodash'); | |
var cheerio = require('cheerio'); | |
var phantom = require('phantom'); | |
var userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1'; | |
var urls = [ |
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
# Transform var AAA = require('BBB'); into import AAA from 'BBB'; | |
ls $DIR/**/*.js | xargs sed -i -r "s/var (.*?) = require\('(.*?)'\);/import \1 from '\2';/" |
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
find $DIR -iname '*.js' -exec sed -i "1 i\'use strict';\n" {} \; |
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
'use strict'; | |
const koa = require('koa'); | |
const Router = require('koa-router'); | |
let app = koa(); | |
let router = new Router({ | |
prefix: '/prefix' | |
}); |
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
class foo | |
{ | |
public: | |
foo() {} | |
}; | |
class bar | |
{ | |
public: | |
bar() {} |
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
from foo import add | |
from time import sleep | |
job = add.delay(1, 2) | |
print("i do some other stuff") | |
sleep(3) |
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
use tabelog_data; | |
INSERT INTO `prefectures` (`name`) | |
VALUES ('北海道'), ('青森'), ('岩手'), ('宮城'), ('秋田'), ('山形'), | |
('福島'), ('茨城'), ('栃木'), ('群馬'), ('埼玉'), ('千葉'), | |
('東京'), ('神奈川'), ('新潟'), ('富山'), ('石川'), ('福井'), | |
('山梨'), ('長野'), ('岐阜'), ('静岡'), ('愛知'), ('三重'), | |
('滋賀'), ('京都'), ('大阪'), ('兵庫'), ('奈良'), ('和歌山'), | |
('鳥取'), ('島根'), ('岡山'), ('広島'), ('山口'), ('徳島'), | |
('香川'), ('愛媛'), ('高知'), ('福岡'), ('佐賀'), ('長崎'), |
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
Vagrant.configure(2) do |config| | |
config.vm.box = "precise64" | |
config.vm.provision "shell", inline: <<-SHELL | |
apt-get install -y curl make g++ git | |
curl -sL https://deb.nodesource.com/setup | bash - | |
apt-get install -y nodejs | |
git clone https://github.com/i18next/i18next-node.git | |
cd i18next-node && npm install && cd .. | |
chown -R vagrant:vagrant i18next-node |
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
path = require 'path' | |
fs = require 'fs-extra' | |
_ = require 'lodash' | |
request = require 'request' | |
baseOutput = path.join __dirname, '.build' | |
module.exports = (grunt) -> | |
reloadPort = grunt.config.get('watch.livereload.options.livereload.port') |