Skip to content

Instantly share code, notes, and snippets.

@amasok
amasok / Vagrantfile.docker
Created August 7, 2019 01:11
Vagrantfile.docker
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider "virtualbox" do |v|
v.memory = 4096
v.cpus = 2
end
config.vm.provision "docker"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
@amasok
amasok / anyframe-widget-insert-docker-ps
Created September 12, 2018 13:03
docker コンテナIDをpecoで選択してプロンプトにinsertする
function anyframe-widget-insert-docker-ps() {
docker ps | tail -n +2 \
| anyframe-selector-auto \
| cut -d" " -f1 \
| anyframe-action-insert
}
zle -N anyframe-widget-insert-docker-ps
bindkey '^xd' anyframe-widget-insert-docker-ps
@amasok
amasok / config
Last active May 23, 2018 06:34
全体のssh_config
Include ./conf.d/*/config
Host *
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
ServerAliveInterval 15
RemoteForward 8377 localhost:8377 # clipperで使用
PasswordAuthentication no
IdentitiesOnly yes
LogLevel FATAL
object Euler{
def main(args: Array[String]) = {
println(problem4)
}
def problem3 = {
def subfactor(n: Long, p: Long): List[Long] =
if (n < p * p)
List(n)
else if (n % p == 0)
@amasok
amasok / iOSwebView1
Created February 20, 2014 10:01
webView:shouldStartLoadWithRequest:navigationTypeでメインコンテンツだけ読み込む。iframeなどは動かさない等の処理に使える
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
if ([request.URL.absoluteString isEqualToString:request.mainDocumentURL.absoluteString]) {
// メインコンテンツの読込時
}
// ...
}
@amasok
amasok / xcode_.gitignore
Created February 18, 2014 07:23
iOS用の.gitignore
# Xcode
build/
Pods/
push
**/xcuserdata/*
**/*.xcworkspace/*
**/*.xcodeproj/*
!**/*.xcodeproj/project.pbxproj
!**/*.xcworkspace/contents.xcworkspacedata
@amasok
amasok / customCell
Last active August 29, 2015 13:56
UITableviewのカスタムセルの設定の仕方
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
TESTCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
NSDictionary *object = _objects[indexPath.row];
NSLog(@"%@",object);
UIImage *image = [UIImage imageNamed:[object objectForKey:@"image"]];
@amasok
amasok / MacVim vimrc
Last active June 3, 2016 08:56
MacVim vimrc
" System vimrc file for MacVim
"
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
" Last Change: Sat Aug 29 2009
set nocompatible
" The default for 'backspace' is very confusing to new users, so change it to a
" more sensible value. Add "set backspace&" to your ~/.vimrc to reset it.