Skip to content

Instantly share code, notes, and snippets.

@anicet
anicet / tmux-cheatsheet.markdown
Created February 9, 2021 10:16 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@anicet
anicet / keybase.md
Created September 5, 2019 08:23
keybase.md

Keybase proof

I hereby claim:

  • I am anicet on github.
  • I am anicet (https://keybase.io/anicet) on keybase.
  • I have a public key ASDbeYnClP9GakMnQqcbIgSXpIgTRPA_HwARjLkOvRusTgo

To claim this, I am signing this object:

@anicet
anicet / pkey_rsa_converter.rb
Last active January 20, 2023 16:20
PKeyRSAConverter: RSAKeyValue .NET XML to RSA PEM (and RSA PEM to RSAKeyValue .NET XML)
require 'openssl'
require 'base64'
require 'rexml/document'
class PKeyRSAConverter
def initialize(from_pem: nil, from_xml: nil)
@from_pem = from_pem
@from_xml = from_xml
end

Keybase proof

I hereby claim:

  • I am anicet on github.
  • I am anicet (https://keybase.io/anicet) on keybase.
  • I have a public key ASD3csUr7OXt5aYubP6NeHUKzg3FTMTjscKHt_6JLrY9ugo

To claim this, I am signing this object:

@anicet
anicet / gist:47bf383a554a76eb7e1c
Created March 20, 2015 08:08
Mongoid map reduce find duplicate email
map = %Q{function() { emit(this.email, 1); }}
reduce = %Q{function(k, v) {return Array.sum(v);}}
User.all.map_reduce(map, reduce).out(inline: true).map{|u|
u["_id"] if u["value"] != 1.0
}.compact
set -g mode-mouse on
set -g mouse-select-pane on
set -g default-terminal "screen-256color"
set -g prefix ^a
unbind ^b
bind a send-prefix
set -g display-time 3000
set -g history-limit 65535
root / torrents#index {:subdomain=>"admin"}
root / static#home
torrents GET /torrents(.:format) torrents#index
POST /torrents(.:format) torrents#create
new_torrent GET /torrents/new(.:format) torrents#new
edit_torrent GET /torrents/:id/edit(.:format) torrents#edit
torrent GET /torrents/:id(.:format) torrents#show
PUT /torrents/:id(.:format) torrents#update
DELETE /torrents/:id(.:format) torrents#destroy