Skip to content

Instantly share code, notes, and snippets.

# Keymap for Atom Emacs key bindings
'.workspace .editor':
'ctrl-h': 'core:backspace'
'ctrl-d': 'core:delete'
'ctrl-a': 'editor:move-to-first-character-of-line'
'ctrl-e': 'editor:move-to-end-of-screen-line'
'ctrl-k': 'editor:delete-line'
@yoshimov
yoshimov / Dockerfile
Created May 22, 2014 08:43
Dockerfile for jekyll build.
# Docker file for Jekyll build
FROM ubuntu:13.10
RUN apt-get update
RUN apt-get install -y ruby2.0 ruby2.0-dev build-essential screen
RUN gem install jekyll
RUN gem install therubyracer
VOLUME [ "/jekyll" ]
@yoshimov
yoshimov / crontab
Created May 15, 2014 10:06
crontab for synchronizing git repositories every 2 hours.
0 */2 * * * cd /home/hoge/git && (git pull && git push) 2>&1 | grep -v 'up-to-date' | mail -E'set nonullbody' -s "title" somebody@gmail.com
@yoshimov
yoshimov / Makefile
Created March 25, 2014 09:15
Makefile for paper with Markdown
# Makefile for paper with Markdown
#
# * Time-stamp: "2014-03-25 18:10:01 nomura"
#
# requires:
# * Cygwin texlive packages
# - texlive
# - texlive-collection-basic
# - texlive-collection-bibtexextra
# - texlive-collection-langcjk
@yoshimov
yoshimov / Dockerfile
Last active August 29, 2015 13:57
Docker file for tty.js
# Docker file for tty.js
#
# To build new image:
#
# > sudo docker build -t ttyjs .
#
# To run the image:
#
# > sudo docker run -d -p 8022:8080 -v /home/hoge:/ttyjs ttyjs
@yoshimov
yoshimov / gist:9543617
Created March 14, 2014 07:48
Obtain email hash for gravatar using ruby.
ruby -e "require 'digest/md5';a='hoge';puts Digest::MD5.hexdigest(a.strip.downcase);"
@yoshimov
yoshimov / notifyIssues.js
Last active August 29, 2015 13:57
Notify specific web page periodically using GAS
function notifyIssues() {
var issueurl = PropertiesService.getScriptProperties().getProperty("issueurl");
var toaddress = PropertiesService.getScriptProperties().getProperty("mailaddress");
var httpuser = PropertiesService.getScriptProperties().getProperty("httpuser");
var httppass = PropertiesService.getScriptProperties().getProperty("httppassword");
var subject = PropertiesService.getScriptProperties().getProperty("subject");
var header = PropertiesService.getScriptProperties().getProperty("header");
var passenc = Utilities.base64Encode(httpuser + ":" + httppass);
var response = UrlFetchApp.fetch(issueurl, {"headers": {"Authorization": "Basic " + passenc}});
var content = response.getContentText();
@yoshimov
yoshimov / Dockerfile
Last active August 29, 2015 13:56
Dockerfile for multibyte enabled Gollum
# Docker file for multibyte enabled Gollum 2.7.0
#
# To build new image:
#
# > sudo docker build -t gollum-server:2.7.0 .
#
# To run the image:
#
# > git init /home/hoge
# > cd /home/hoge
*** ./lib/gollum-lib/committer.rb.org Thu Feb 27 00:23:14 2014
--- ./lib/gollum-lib/committer.rb Thu Feb 27 00:24:20 2014
***************
*** 118,124 ****
end
end
! fullpath = fullpath.force_encoding('ascii-8bit') if fullpath.respond_to?(:force_encoding)
begin
*** ./lib/gollum/helpers.rb.org Thu Feb 27 00:19:51 2014
--- ./lib/gollum/helpers.rb Thu Feb 27 00:20:35 2014
***************
*** 6,12 ****
return nil if file_path.nil?
last_slash = file_path.rindex("/")
if last_slash
! file_path[0, last_slash]
end
end