Skip to content

Instantly share code, notes, and snippets.

View minawk's full-sized avatar

Benjamina Randrianasolo minawk

View GitHub Profile
@NigelEarle
NigelEarle / Knex-Setup.md
Last active May 4, 2024 13:36
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active May 3, 2024 10:44
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

function fish_mode_prompt --description 'Displays the current mode'
# Do nothing if not in vi mode
if test "$fish_key_bindings" = "fish_vi_key_bindings"
switch $fish_bind_mode
case default
set_color --bold red
echo 🅽
case insert
set_color --bold green
echo 🅸
@zchee
zchee / tmux-default-bind-key.tmux
Last active August 10, 2022 08:26
Tmux default bind-key
bind-key C-b send-prefix
bind-key C-o rotate-window
bind-key C-q confirm-before kill-server
bind-key C-z suspend-client
bind-key Space next-layout
bind-key ! break-pane
bind-key # list-buffers
bind-key $ command-prompt -I #S "rename-session '%%'"
bind-key & confirm-before -p "kill-window #W? (y/n)" kill-window
# Commennt out caused by Gist syntax error
@TheItachiUchiha
TheItachiUchiha / ToggleSwitch
Last active March 31, 2023 07:15
A simple Toggle Switch using JavaFX
import javafx.beans.property.SimpleBooleanProperty;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
public class ToggleSwitch extends HBox {
private final Label label = new Label();
@tsl0922
tsl0922 / .tmux.conf
Last active April 30, 2024 10:29
vim style tmux config
# vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
@stongo
stongo / app.js
Last active January 23, 2024 18:48
Joi validation in a Mongoose model
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', function() {
return console.error.bind(console, 'connection error: ');
});
@fzerorubigd
fzerorubigd / i3config
Created August 1, 2013 12:43
my i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@jonsuh
jonsuh / js-ajax-php-json-return.html
Last active September 17, 2022 02:57
jQuery AJAX Call to PHP Script with JSON Return
<div class="the-return">
[HTML is replaced when successful.]
</div>
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname