Skip to content

Instantly share code, notes, and snippets.

@rachidbch
rachidbch / #shell
Last active June 11, 2021 01:17 — forked from kostaz/install-ripgrep-on-ubuntu.sh
Install ripgrep on Ubuntu
# Dummy file to give the Gist a proper name.
# Gist name is given by the first file in alphabetic order.
# This ia the reasons our Gists names are all prefixed by a `#`
@rachidbch
rachidbch / tmux-cheats.md
Last active May 12, 2018 14:37 — forked from Starefossen/tmux-cheats.md
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@rachidbch
rachidbch / expecting.md
Created November 6, 2017 18:32 — forked from ksafranski/expecting.md
Basic principles of using tcl-expect scripts

Intro

TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

#!/usr/bin/expect
@rachidbch
rachidbch / dom-helper.js
Created July 18, 2017 16:20 — forked from SitePointEditors/dom-helper.js
Mini jQuery, sort of.
/**
* A collection of helper prototype for everyday DOM traversal, manipulation,
* and event binding. Sort of a minimalist jQuery, mainly for demonstration
* purposes. MIT @ m3g4p0p
*/
window.$ = (function (undefined) {
/**
* Duration constants
* @type {Object}
// routes.js
const routes = [
{
path: '/',
component: Home,
exact: true
},
{
path: '/gists',
component: Gists
@rachidbch
rachidbch / ramda
Last active July 28, 2016 09:19 — forked from raine/ramda
Browse Ramda documentation in Terminal
#!/usr/bin/env bash
# Cette snippet permet de faire une recherche interactive en ligne de commande dans un document JSON.
# Ici c'est utilisé pour faire un live search de la doc Ramda mais le même principe peut être utilisé pour toute documentation structurée
# Browse Ramda documentation in Terminal
# Requires jq and a tool such as fzf or peco for interactive filtering
LATEST="http://raine.github.io/ramda-json-docs/latest.json"
DOCS_URL="http://ramdajs.com/docs/"
@rachidbch
rachidbch / build-zsh.sh
Created June 22, 2016 17:33 — forked from nicoulaj/build-zsh.sh
Build Zsh from sources on Ubuntu
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh
<section data-background-transition='zoom' data-transition='concave' data-background='http://ryanjarvinen.com/presentations/shared/img/broadcast_reveal_dark.png' data-state='blackout'>
<h1>Mobile First Century</h1>
<h3>Gist & Reveal.js Powered</h2>
<h2>Presentation Slides</h2>
<p class='fragment'><small><a class='fragment' href='http://github.com/ryanj/gist-reveal.it'>github.com/ryanj/gist-reveal.it</a>
<br/> <a class='fragment' href='https://registry.hub.docker.com/u/ryanj/gist-reveal.it/'>registry.hub.docker.com/u/ryanj/gist-reveal.it</a></small></p>
</section>
<section data-background-transition='zoom' data-transition='linear'>
<h2>Try it out!</h2>
<p>Create your own deck by forking a copy of <a href='https://gist.github.com/ryanj/af84d40e58c5c2a908dd'>this github gist</a>: <br /><a href='https://gist.github.com/ryanj/af84d40e58c5c2a908dd'>https://gist.github.com/ryanj/af84d40e58c5c2a908dd</a></p>