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
# ERB-TEMPLATEを便利に書くためのクラス | |
# | |
# 使い方 | |
# module TEST_CONST | |
# extends TemplateGenerater | |
# TEST = "test_string-<%= id %>" | |
# end | |
# | |
# TEST_CONST::test(id: 1) #=> "test_string-1" | |
# TEST_CONST::test(id: 2) #=> "test_string-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
// VSで確認するには C/C++ -> Assemby Outputの項目をAssembly-Only Listing (/FA)に設定 | |
class base | |
{ | |
public: | |
virtual fn() = 0; | |
}; | |
Class A | |
{ | |
public: | |
fn() override { something; } |
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
require "fiddle/import" | |
require 'fiddle/types' | |
# オリジナル(Win32APIライブラリを使う版)はこちら | |
# https://rubyist.g.hatena.ne.jp/edvakf/20110405/1301973681 | |
module WIN32API | |
extend Fiddle::Importer | |
dlload 'C:\\Windows\\System32\\kernel32.dll' | |
include Fiddle::Win32Types | |
extern 'DWORD GetCurrentProcessId()' |
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
COMMAND=echo | |
#COMMAND=curl | |
echo MESSAGE=あいうえお&submit=書き込む | iconv -t euc-jp > data.message | |
$COMMAND -v -d 'DIR=game' -d 'BBS=12345' -d 'KEY=1234567890' \? | |
-d "TIME=$(date +%s)" -d 'NAME="" \ | |
-d "MAIL=sage" -d @data.message \ | |
-e http://jbbs.shitaraba.net/bbs/read.cgi/game/12345/1234567890/ \ | |
http://jbbs.shitaraba.net/bbs/write.cgi/game/12345/1234567890/ |
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 bash | |
# names of latest versions of each package | |
export NGINX_VERSION=1.9.12 | |
export VERSION_PCRE=pcre-8.38 | |
export VERSION_LIBRESSL=libressl-2.3.2 | |
export VERSION_NGINX=nginx-$NGINX_VERSION | |
#export NPS_VERSION=1.9.32.10 | |
#export VERSION_PAGESPEED=v${NPS_VERSION}-beta | |
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
######################### | |
# debian jessie on vagrant/VM | |
# sudoedit /etc/systemd/system/create-ssh-host-keys.service | |
# CHECK: | |
# systemctl list-unit-files --type=service | grep create | |
# ENABLE: | |
# systemctl enable create-ssh-host-keys | |
# systemctl start create-ssh-host-keys | |
[Unit] | |
Description=Create SSH host 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
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/srv --entrypoint /bin/cp svendowideit/samba -r /usr/share/doc/samba/examples/LDAP /srv |
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
apt-get download samba | |
dpkg-deb -x samba*.deb extract_here |
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
#config/boot.rb | |
# ~ | |
require 'rails/commands/server' | |
module DefaultOptions | |
def default_options | |
super.merge!(Host:'0.0.0.0', Port: 3000) | |
end | |
end | |
Rails::Server.send(:prepend, DefaultOptions) |
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
// ページ読み込みが完了した時に実行 | |
document.addEventListener("DOMContentLoaded", e => { | |
console.log('fired ->', e.type, e.timeStamp) | |
// turbolinksを有効にしている時 | |
document.addEventListener('turbolinks:load', (evt)=>{ | |
console.log('will render ->', evt.type, evt.timeStamp) | |
let elm = document.getElementById('padapp') | |
if (!elm) { return ; } |
OlderNewer