This file contains hidden or 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; basic emacs configuration to be used in conjunction with prelude ;; | |
;; pragmaticemacs.com/installing-and-setting-up-emacs/ ;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;Add MELPA repository for packages | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.org/packages/") t) | |
(add-to-list 'package-archives | |
'("melpa-stable" . "http://stable.melpa.org/packages/") t) |
This file contains hidden or 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
- hosts: localhost | |
connection: local | |
gather_facts: no | |
sudo: no | |
vars: | |
homebrew_taps: | |
- homebrew/binary | |
- homebrew/versions | |
- homebrew/dupes | |
- homebrew/dupes |
This file contains hidden or 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
select | |
ordinal_position | |
, column_name | |
, data_type | |
, table_name | |
from | |
information_schema.columns | |
where | |
table_name = dbo.items | |
order by |
This file contains hidden or 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
/* | |
* dependencies: | |
* Moment: 'MHMchiX6c1bwSqGM1PZiW_PxhMjh3Sh48' | |
* SlackApp: 'M3W5Ut3Q39AaIwLquryEPMwV62A3znfOO' | |
* Google Advanced Services: URL Shortener API - urlshortener v1 | |
*/ | |
'use strict'; | |
var CONSTANT = { |
This file contains hidden or 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
select distinct | |
u.id | |
, u.last_name | |
, u.first_name | |
, u.last_name_kana | |
, case when d.user_id is null | |
then 2 | |
when d.user_id is not null | |
then 1 | |
end |
This file contains hidden or 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
;; -*- coding: utf-8; lexical-binding: t -*- | |
;; emacs -Q --script remove-match-lines-single.el log.txt '^\n.*\n' | |
(defun remove-match-lines (file regex) | |
(with-current-buffer (find-file-noselect file) | |
(goto-char (point-min)) | |
(while (re-search-forward regex nil t) | |
(replace-match "")) | |
(save-buffer))) |
This file contains hidden or 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
;; -*- coding: utf-8; lexical-binding: t -*- | |
;; emacs -Q --script remove-match-lines-multiple.el log.txt | |
(defun remove-match-lines (file patterns) | |
(with-current-buffer | |
(find-file-noselect file) | |
(mapcar | |
(lambda (x) | |
(goto-char (point-min)) | |
(while (re-search-forward x nil t) |
This file contains hidden or 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
;; -*- coding: utf-8; lexical-binding: t -*- | |
;; get-num.el abc.txt xyz | |
(require 'cl-extra) | |
(defun get-num (file words) | |
(with-temp-buffer | |
(insert-file-contents-literally file) | |
(goto-char (point-min)) | |
(unless | |
(cl-some #'null |
This file contains hidden or 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
;; -*- coding: utf-8; lexical-binding: t -*- | |
;; get-num-dash.el abc.txt xyz | |
(load-file (expand-file-name "~/.emacs.d/elpa/s-xxxxxxxxx.xxxx/s.el")) | |
(load-file (expand-file-name "~/.emacs.d/elpa/dash-xxxxxxxxx.xxxx/dash.el")) | |
(load-file (expand-file-name "~/.emacs.d/elpa/dash-functional-xxxxxxxx.xxxx/dash-functional.el")) | |
(load-file (expand-file-name "~/.emacs.d/elpa/f-xxxxxxxxx.xxxx/f.el")) | |
(load-file (expand-file-name "~/.emacs.d/elpa/ht-xxxxxxxxx.xxxx/ht.el")) | |
(require 'cl-extra) | |
(defun get-num (file words) |
This file contains hidden or 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 ruby | |
# -*- coding: utf-8 -*- | |
require 'rake/testtask' | |
task :default => [:test] | |
Rake::TestTask.new do |t| | |
t.libs << 'test' | |
t.test_files = Dir['test/**/test_*.rb'] | |
t.verbose = true |