As configured in my dotfiles.
start new:
tmux
start new with session name:
| ;; | |
| ;; NS CHEATSHEET | |
| ;; | |
| ;; * :require makes functions available with a namespace prefix | |
| ;; and optionally can refer functions to the current ns. | |
| ;; | |
| ;; * :import refers Java classes to the current namespace. | |
| ;; | |
| ;; * :refer-clojure affects availability of built-in (clojure.core) | |
| ;; functions. |
| # yes, sometimes you need to do this. you get pilloried in a forum if you | |
| # ask about it, though! | |
| # this code taken from | |
| # http://wholemeal.co.nz/blog/2011/04/05/rendering-from-a-model-in-rails-3/ | |
| class MyModel < ActiveRecord::Base | |
| # Use the my_models/_my_model.txt.erb view to render this object as a string | |
| def to_s | |
| ActionView::Base.new(Rails.configuration.paths.app.views.first).render( |
| ; A REPL-based, annotated Seesaw tutorial | |
| ; Please visit https://github.com/daveray/seesaw for more info | |
| ; | |
| ; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers | |
| ; Seesaw's basic features and philosophy, but only scratches the surface | |
| ; of what's available. It only assumes knowledge of Clojure. No Swing or | |
| ; Java experience is needed. | |
| ; | |
| ; This material was first presented in a talk at @CraftsmanGuild in | |
| ; Ann Arbor, MI. |
As configured in my dotfiles.
start new:
tmux
start new with session name:
In one of my pet projects, I redirect all requests to index.php, which then decides what to do with it:
This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to index.php:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
| # Rime alternative settings | |
| # encoding: utf-8 | |
| # | |
| # difference from default settings: | |
| # 1. ascii-style punctuation in half-shape mode | |
| # 2. [ ] as paging keys | |
| # | |
| # save this file as: | |
| # (Linux) ~/.config/ibus/rime/alternative.yaml | |
| # (Mac OS) ~/Library/Rime/alternative.yaml |
| body { | |
| font-family: Helvetica, arial, sans-serif; | |
| font-size: 14px; | |
| line-height: 1.6; | |
| padding-top: 10px; | |
| padding-bottom: 10px; | |
| background-color: white; | |
| padding: 30px; } | |
| body > *:first-child { |
| /** | |
| * Angular needs to send the Rails CSRF token with each post request. | |
| * | |
| * Here we get the token from the meta tags (make sure <%= csrf_meta_tags %> | |
| * is present in your layout.) | |
| */ | |
| angular.module('myapp',[]). | |
| // configure our http requests to include the Rails CSRF token | |
| config(["$httpProvider", function(p) { | |
| var m = document.getElementsByTagName('meta'); |
I 'm fleshing out some of these ideas here: https://github.com/lynaghk/todoFRP/tree/master/todo/angular-cljs
| #include <regex> | |
| #include <string> | |
| #include <vector> | |
| std::vector<std::string> Split(const std::string& str, const std::string& regex) | |
| { | |
| return {std::sregex_token_iterator(str.begin(), str.end(), std::regex(regex), -1), std::sregex_token_iterator()}; | |
| } |