hcl-mode 0.01 released
hcl-mode 0.01 is out. hcl-mode provides major mode of HCL(Hashicorp Configuration Language). Currently hcl-mode provide indentation, highlighting, some cursor moving commands. If you have any issues or suggestions, please report me via github issues, I'll try to implement/fix as possible.
Repository
https://github.com/syohex/emacs-hcl-mode
Installation
You can install hcl-mode from MELPA with package.el.
Screenshot
helm-do-ag supports command line options
We can input command line options at helm-do-ag as following Gif animation.
If you want to use pattern which starts with -
, please use --
separator.
集中線GIFメーカー in Golang
http://hitode909.hatenablog.com/entry/2015/09/13/205925
I wrote @hitode909's 集中線GIFメーカー(Awesome Web application) in Golang. This is command line application and you can use this as below.
Repository
https://github.com/syohex/speedline
Sample Output
Code
package main import ( "flag" "fmt" "math" "math/rand" "github.com/gographics/imagick/imagick" ) var ( output = flag.String("o", "output.gif", "output filename") color = flag.String("color", "black", "background color") ) func speedLine(mw *imagick.MagickWand, aw *imagick.MagickWand) error { cols, rows := mw.GetImageHeight(), mw.GetImageWidth() dw := imagick.NewDrawingWand() defer dw.Destroy() cw := imagick.NewPixelWand() cw.SetColor(*color) dw.SetFillColor(cw) center := []float64{float64(cols) / 2.0, float64(rows) / 2.0} const radiusCenter float64 = 0.75 const step float64 = 0.02 const bold float64 = 1.0 var theeta float64 for theeta < math.Pi*2 { stepNoise := rand.Float64() + 0.5 theeta += step * stepNoise radiusCenterNoise := rand.Float64()*0.3 + 1.0 boldNoise := rand.Float64() + 0.7 + 0.3 point0 := imagick.PointInfo{ X: math.Sin(theeta)*center[0]*radiusCenter*radiusCenterNoise + center[0], Y: math.Cos(theeta)*center[1]*radiusCenter*radiusCenterNoise + center[1], } point1 := imagick.PointInfo{ X: math.Sin(theeta)*center[0]*2 + center[0], Y: math.Cos(theeta)*center[1]*2 + center[1], } point2 := imagick.PointInfo{ X: math.Sin(theeta+step*bold*boldNoise)*center[0]*2 + center[0], Y: math.Cos(theeta+step*bold*boldNoise)*center[1]*2 + center[1], } dw.Polygon([]imagick.PointInfo{point0, point1, point2}) } if err := aw.DrawImage(dw); err != nil { return err } return nil } func main() { flag.Parse() imagick.Initialize() defer imagick.Terminate() mw := imagick.NewMagickWand() defer mw.Destroy() aw := imagick.NewMagickWand() defer aw.Destroy() if err := mw.ReadImage(flag.Arg(0)); err != nil { panic(err) } if int(mw.GetNumberImages()) == 1 { mw.SetIteratorIndex(0) first := mw.GetImage() mw.ResetIterator() for i := 0; i < 3; i++ { mw.AddImage(first.Clone()) } } for i := 0; i < int(mw.GetNumberImages()); i++ { mw.SetIteratorIndex(i) tw := mw.GetImage() aw.AddImage(tw) if err := speedLine(tw, aw); err != nil { fmt.Println(err) return } tw.Destroy() } mw.ResetIterator() aw.SetOption("loop", "0") if err := aw.WriteImages(*output, true); err != nil { panic(err) } }
Emacs daemon memo
Run named daemon
Emacs --daemon
command line option can accept name argument(like --daemon=server1
).
% emacs --daemon=vim -Q % emacs --daemon=atom -Q
Sending S-expression via emacsclient
And we can specify server by -s
(--socket-name
) option of emacsclient
as below. (We can also specify socket file path instead of daemon name)
% emacsclient -s vim -e '(emacs-pid)' % emacsclient -s atom -e '(shell-command-to-string "vim --version")'
Shutdown emacs daemon
We can stop daemon by sending kill-emacs
% emacsclient -s vim -e '(kill-emacs)'
If you stop emacs daemon by kill command, you should also remove socket file at ${temporary-file-directory}/emacs${pid}/${servername}
such as /tmp/emacs1000/vim
.
Better space handling in helm-do-ag
I have implemented better space handling in helm-ag. If you want to input pattern which contains space, you can use escaped space like pattern1\ pattern2
. Such pattern matches lines which have pattern1 pattern2
. (While pattern1 pattern2
matches lines which have both pattern1
and pattern2
.
Example
First I input apple orange
. This pattern matches all lines because all line have both apple
and orange
. Second I input apple\ orange
, first and third line are matched but second line is not matches because second line does not have apple orange
ac-emoji for Linux users
We can use emoji fonts other than MacOSX platform. (However MacOSX fonts is good looking :-()
Installing Symbola font
Download Symbola.ttf
and put it into fonts directory such as ~/.fonts
.
% cd ~/.fonts % curl -LO http://zhm.github.io/symbola/fonts/Symbola.ttf
NOTE
Debian/Ubuntu provides Symbola font as package, ttf-ancient-fonts
or ttf-ancient-fonts-symbola
. And some other distributions provide too. Please check your package system before installing Symbola font manually.
Configuration
Add following configuration in your init.el
(set-fontset-font t 'symbol (font-spec :family "Symbola") nil 'prepend)
Screenshot
We can use emoji on Linux now.