Skip to content

Instantly share code, notes, and snippets.

@zdenal
zdenal / install_xelatex_on_mac.txt
Created February 2, 2021 20:43 — forked from peterhurford/install_xelatex_on_mac.txt
How to install latex and xelatex on Mac so that Jupyter "Download as PDF" will work
brew install pandoc
brew tap homebrew/cask
brew cask install basictex
eval "$(/usr/libexec/path_helper)"
# Update $PATH to include `/usr/local/texlive/2020basic/bin/x86_64-darwin`
sudo tlmgr update --self
sudo tlmgr install texliveonfly
sudo tlmgr install xelatex
sudo tlmgr install adjustbox
sudo tlmgr install tcolorbox
@zdenal
zdenal / README.md
Created March 5, 2019 10:48 — forked from slashdotdash/README.md
Commanded middleware to enrich commands during dispatch, such as calling an external API.

Commanded middleware for command enrichment

Usage

Add the EnrichCommand middleware to your command router:

defmodule MyApp.Router do
  use Commanded.Commands.Router
 
@zdenal
zdenal / Ruby Lambdas.md
Created January 7, 2017 22:58 — forked from Integralist/Ruby Lambdas.md
Ruby lambdas

Lambda: standard

# Creating a lambda
l = lambda { |name| "Hi #{name}!" }

# Executing the lambda
l.call("foo") # => Hi foo!
@zdenal
zdenal / .vimrc
Created November 11, 2016 20:54 — forked from millermedeiros/.vimrc
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory.
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR
" -----------------------------------------------------------------------------
macro_rules! with_key {
($($t:ty),+) => ($(
impl WithKey for $t {
fn key(&self) -> &str {
&self.key
}
}
)+);
}
@zdenal
zdenal / Gemfile
Last active September 19, 2015 18:57 — forked from syon/Gemfile
SVG-to-PNG Converter using Ruby-GNOME2/RSVG on Sinatra
source "https://rubygems.org"
gem "sinatra"
gem "haml"
gem "rsvg2"
{
"predef": {
...
"Bugsnag": true,
...
},
...
}
@zdenal
zdenal / app.js
Created August 20, 2014 14:20 — forked from jgoux/app.js
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
# db/migrate/20131118172653_create_transactional_items_view.rb
class CreateTransactionalItemsView < ActiveRecord::Migration
def up
select_sql = File.open("#{Rails.root}/db/migrate/20131118172653_create_transactional_items_view.sql", 'r') { |f| f.read }
# for materialized view:
view_sql = "CREATE MATERIALIZED VIEW transactional_items AS (#{select_sql})"
# for normal view:
view_sql = "CREATE VIEW transactional_items AS (#{select_sql})"

How to set up your VPS with Chef Solo

1. What is it?

There are many different provisioning tools out there, the most popular of which are Chef and Puppet. Chef uses Ruby, Puppet uses a DSL (Domain Specific Language), there are others that use simple bash too, but today we're going to focus on Chef Solo.

2. Dependencies

To get Chef working properly on your local machine you need a few things.

Make sure you use Ruby 1.9.x and not Ruby 2.x as you will get errors with the json 1.6.1 gem on 2.x. Use rbenv or RVM to manage several different Rubies on the one machine.