Skip to content

Instantly share code, notes, and snippets.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 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)
- hosts: localhost
connection: local
gather_facts: no
sudo: no
vars:
homebrew_taps:
- homebrew/binary
- homebrew/versions
- homebrew/dupes
- homebrew/dupes
select
ordinal_position
, column_name
, data_type
, table_name
from
information_schema.columns
where
table_name = dbo.items
order by
/*
* dependencies:
* Moment: 'MHMchiX6c1bwSqGM1PZiW_PxhMjh3Sh48'
* SlackApp: 'M3W5Ut3Q39AaIwLquryEPMwV62A3znfOO'
* Google Advanced Services: URL Shortener API - urlshortener v1
*/
'use strict';
var CONSTANT = {
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
;; -*- 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)))
;; -*- 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)
;; -*- 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
;; -*- 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)
#!/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