View Dockerfile
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 alpine:latest | |
ENV MYSQL_CONNECTOR_VERSION 2.1.3 | |
ENV MYSQL_CONNECTOR_ARCHIVE mysql-connector-python-${MYSQL_CONNECTOR_VERSION}.tar.gz | |
ENV MYSQL_KEYID 5072E1F5 | |
COPY ${MYSQL_CONNECTOR_ARCHIVE}.asc ${MYSQL_CONNECTOR_ARCHIVE}.asc | |
RUN apk add --no-cache --virtual .deps curl mysql-dev gnupg file gcc python-dev musl-dev g++ && \ | |
apk add --no-cache python && \ |
View counterstring.js
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
function counterstring(length) { | |
var curNum = length; | |
var outLen = 0; | |
var numbers = []; | |
var curStr; | |
while (outLen < length) { | |
curStr = curNum.toString() + "*"; | |
curNum -= curStr.length; | |
if (outLen + curStr.length <= length) { |
View ws.js
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
exports.websocket = { | |
connect: function (address) { | |
var ws = new WebSocket(address); | |
var promise = new Promise(function (resolve, reject) { | |
ws.onopen = function (e) { | |
var wsObj = { | |
socket: ws, | |
handlers: {} | |
}; |
View replace-all.el
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
(provide 'mystuff) | |
(defun replace-all (from to) | |
(interactive "sReplace: \nsWith: ") | |
(save-excursion | |
(goto-char (point-min)) | |
(replace-string from to) | |
) | |
) |
View .emacs
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
;; Useful stuff for .emacs | |
;;;;; | |
;; Key-bindings | |
;;;;; | |
(global-set-key (kbd "C-x C-b") 'ibuffer) | |
(global-set-key (kbd "C-c C-q") 'comment-or-uncomment-region) | |
;;;;; |
View gist:daeb0787dcfb3c9982a0
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
## .tmux.conf | |
set -g status-bg default | |
set -g status-fg white | |
set -g status-left "#[fg=green]#H" | |
set-window-option -g window-status-current-bg blue | |
set -g status-interval 10 | |
bind M-w run-shell "tmux save-buffer - | xclip -i" |
View kv
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
# -*- mode: snippet -*- | |
# name: keyvalue | |
# key: kv | |
# type: command | |
# -- | |
(let ((yas-good-grace nil) | |
(count (* 2 (read-number "Number of elements: ")))) | |
(yas-expand-snippet | |
(concat "{\n" | |
"\t" |