index.ts
import Immutable from 'immutable';
// this transpiles to the same thing as testJS
const testTS = (arraySize: number): void => {
const array: readonly number[] = Array(arraySize).fill(0);
const t0 = performance.now();
index.ts
import Immutable from 'immutable';
// this transpiles to the same thing as testJS
const testTS = (arraySize: number): void => {
const array: readonly number[] = Array(arraySize).fill(0);
const t0 = performance.now();
Syntax | Description |
---|---|
lpass login | log in (initiates password prompt) |
lpass show -c --password <amazon.com> | copy password for to clipboard |
lpass ls | list all services |
This is my first Arch install and I keep forgetting or using unsafe pacman commands, so I made a thing.
Arch's philosophy is to be modular, give you control over everything, and allow you to shoot yourself in the foot every other day until you run out of toes.
This guide is meant to be used as a quick reference and prioritizes safe, sane defaults, but you should read the pacman docs first. They're a quick read, and will save you some pain later.
Pacman only works with official repos - unofficial repos are listed in aur, the Arch Linux Repository. It's common to use yay, a wrapper that allows you to easily use both aur and the official repository:
defmodule FizzBuzz do | |
def run do | |
1..100 | |
|> Enum.each(& print(&1)) | |
end | |
defp print(n) when rem(n, 15) == 0 do | |
IO.puts("fizzbuzz") | |
end |
" Vim color file | |
" | |
" Author: Tomas Restrepo <[email protected]> | |
" https://github.com/tomasr/molokai | |
" | |
" Note: Based on the Monokai theme for TextMate | |
" by Wimer Hazenberg and its darker variant | |
" by Hamish Stuart Macpherson | |
" |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
colorscheme molokai | |
set t_Co=256 | |
" https://github.com/kien/ctrlp.vim | |
set runtimepath^=~/.vim/bundle/ctrlp.vim | |
" use spaces instead of tabs |
class CardsController < ApplicationController | |
respond_to :json | |
def index | |
@cards = Card.all | |
end | |
end |
2.1.0 :013 > String.send(:define_method, :awesome) { "#{self} is awesome!" } | |
=> :awesome | |
2.1.0 :014 > "Ruby".awesome | |
=> "Ruby is awesome!" |
require 'rspec/core/rake_task' | |
task :default => :spec | |
desc "Run the specs." | |
task :spec do | |
RSpec::Core::RakeTask.new do |t| | |
t.pattern = "spec/*/*_spec.rb" | |
end | |
end |
class Memcached | |
attr_writer :expiration | |
def initialize | |
@cache = {} | |
@expiration = Float::MAX | |
end | |
def set(key, &value) | |
@cache[key] = {value: value.call, time: Time.new} |