Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#!/bin/bash | |
# Install Monaco font in Linux | |
# Version from nullvideo https://gist.github.com/rogerleite/99819#gistcomment-2799386 | |
sudo mkdir -p /usr/share/fonts/truetype/ttf-monaco && \ | |
sudo wget https://gist.github.com/rogerleite/b50866eb7f7b5950da01ae8927c5bd61/raw/862b6c9437f534d5899e4e68d60f9bf22f356312/mfont.ttf -O - > \ | |
/usr/share/fonts/truetype/ttf-monaco/Monaco_Linux.ttf && \ | |
sudo fc-cache |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
There are many (old) clients available:
The Google Analytics API is at v3 (at time of writing).
This example uses Google's Ruby API client to access Analytics. Use https://github.com/google/google-api-ruby-client (Google supported).
module Rack | |
module Session | |
class Flash | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
dup.call!(env) | |
end |
In the controller action
image_file = change_img_params(params[:avatar]) #params[:avatar] - base64 string
def change_img_params(img)
begin
Base64.decode64(img) #To check if thats a base64 string
if img
img = file_decode(img.split(',')[1],"some file name") #getting only the string leaving out the data/<format>
end
In Clojure you can apply destructuring within either a let
binding list; function parameter list or even a macro.
A simple example would be:
(def coords [5 7]) ; define a symbol "coords" that points to a vector [5 7]
(let [[x y] coords] (println "x:" x "y:" y))
; => x: 5 y: 7
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
require 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
describe "GET #index" do | |
#describe "POST #create" do | |
#describe "GET #show" do | |
#describe "PATCH #update" do (or PUT #update) | |
#describe "DELETE #destroy" do | |
#describe "GET #new" do |