Skip to content

Instantly share code, notes, and snippets.

View RakibFiha's full-sized avatar
🏠
Working from home

Rakib Fiha RakibFiha

🏠
Working from home
View GitHub Profile
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
# Connectiong by SSH from Android Termux to Desktop and vice-versa.md
# Copyright (c) 2019 Evandro Coan
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
@Spencer-Easton
Spencer-Easton / exportSpreadsheet.gs
Last active March 21, 2024 00:43
Example on how to export a Google sheet to various formats, includes most PDF options
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export
//FORMATS WITH NO ADDITIONAL OPTIONS
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped
@joar
joar / jq-insert-var.sh
Last active March 18, 2024 16:06
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{
@RakibFiha
RakibFiha / docker
Last active February 24, 2024 06:58
docker wrapper for podman, colima and docker
#!/usr/bin/env bash
# Author: rakibfiha
# Usage: Save it to $HOME/.local/bin/docker and add this path to your $PATH
# ENV: DOCKER_RUNTIME=podman|colima-containerd; Default: colima-containerd
# For colima: colima start --runtime containerd
# For podman: podman machine init && podman machine start and set DOCKER_RUNTIME=podman
# For docker: set DOCKER_RUNTIME=full/path/to/docker/executable
runtime_exists() {
@niw
niw / Vagrantfile
Last active February 22, 2024 10:21
A simple Vagrantfile to setup Ubuntu desktop environment with Google Chrome and Japanese input
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider :virtualbox do |v|
v.gui = true
v.memory = 2048
end
# Currently "ubuntu/bionic64" on VirtualBox requires `type: "virtualbox"`
# to make synced folder works.
@seeebiii
seeebiii / LambdaConstants.java
Last active February 9, 2024 04:17
Available default environment variables in AWS Lambda. Just copy&paste into your Node or Java project.
public class Constants {
/**
* Contains the path to your Lambda function code.
*/
public static final String LAMBDA_TASK_ROOT = System.getenv("LAMBDA_TASK_ROOT");
/**
* The environment variable is set to one of the following options, depending on the runtime of the Lambda function:
* AWS_Lambda_nodejs, AWS_Lambda_nodejs4.3, AWS_Lambda_nodejs6.10
@atiensivu
atiensivu / GnomeShellExtensions
Created September 11, 2017 20:13
Gnome Tweak Tool - enable user themes - No such schema “org.gnome.shell.extensions.user-theme”
sudo cp $HOME/.local/share/gnome-shell/extensions/user-theme@gnome-shell-extensions.gcampax.github.com/schemas/org.gnome.shell.extensions.user-theme.gschema.xml /usr/share/glib-2.0/schemas && sudo glib-compile-schemas /usr/share/glib-2.0/schemas
# One liner fix that shouldn't be necessary
@lumengxi
lumengxi / Makefile
Created March 17, 2016 16:44
Makefile for Python projects
.PHONY: clean-pyc clean-build docs clean
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
@tomysmile
tomysmile / setup-vagrant-macosx.md
Created April 26, 2016 05:54
How to Install Virtualbox and Vagrant on MacOSX

Install Virtualbox && Vagrant for MacOSX

Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.

$ brew cask install virtualbox

Now install Vagrant either from the website or use homebrew for installing it.