As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
| import ( | |
| "net/http" | |
| "net/http/httputil" | |
| "net/url" | |
| "fmt" | |
| ) | |
| func main() { | |
| // New functionality written in Go | |
| http.HandleFunc("/new", func(w http.ResponseWriter, r *http.Request) { |
| <?php | |
| /** | |
| * Turn all URLs in clickable links. | |
| * | |
| * @param string $value | |
| * @param array $protocols http/https, ftp, mail, twitter | |
| * @param array $attributes | |
| * @param string $mode normal or all | |
| * @return string | |
| */ |
| data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
| <!-- | |
| For other language: Instead of `ace/mode/ruby`, Use | |
| Markdown -> `ace/mode/markdown` | |
| Python -> `ace/mode/python` | |
| C/C++ -> `ace/mode/c_cpp` | |
| Javscript -> `ace/mode/javascript` | |
| Java -> `ace/mode/java` | |
| Scala- -> `ace/mode/scala` |
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>How to convert HTML form data to JS object (for using with AJAX)</title> | |
| </head> | |
| <body> | |
| <form id="contact-form" action="/" method="post"> |
| // Copyright (c) 2017 Ismael Celis | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: | |
| // The above copyright notice and this permission notice shall be included in all |
| package main | |
| import ( | |
| "net/http" | |
| "log" | |
| ) | |
| func redirect(w http.ResponseWriter, req *http.Request) { | |
| // remove/add not default ports from req.Host | |
| target := "https://" + req.Host + req.URL.Path | |
| if len(req.URL.RawQuery) > 0 { |
| ## FastCGI | |
| server { | |
| location ~ /app.* { | |
| fastcgi_pass 127.0.0.1:9000; | |
| include fastcgi_params; | |
| } | |
| } | |
| ## Reverse Proxy (이 방식으로 하면 http.ListenAndServe로 해야함) | |
| server { |
##git mergetool
In the middle file (future merged file), you can navigate between conflicts with ]c and [c.
Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).
:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
| require 'tire' | |
| # Tire.configure { logger STDERR, level: 'debug' } | |
| Tire.index('movie-titles') do | |
| delete | |
| create \ | |
| settings: { | |
| index: { | |
| analysis: { |