Skip to content

Instantly share code, notes, and snippets.

#!/bin/zsh
green=$'\e[32m'
yellow=$'\e[1;33m'
white=$'\e[0m'
blue=$'\e[1;34m'
# Manual steps :
# Install Chrome : https://www.google.com/chrome/
# Customise System preferences (can use AppleScript to automate this too to some extent)
# - Keyboard for cursor speed and Touch Bar
@blizzrdof77
blizzrdof77 / new_env_var.sh
Created September 15, 2020 23:03
Create new environment variable & print assignment statement to your shell's '.rc' file
# -----------------------------------------
# Create new environment variable & print assignment statement to your shell's '.rc' file
#
# @1 = variable new
# @2 = variable definition
# @requires: '~/.zshrc' or '~/.bashrc'
# -----------------------------------------
function new_env_var {
local detected_shell="$(ps -o comm= -p $$)"
local rcfile=$(echo "${HOME}/.${detected_shell//-/}rc")
@GimmyHchs
GimmyHchs / slice_tricks.md
Last active November 9, 2025 14:11
[Go SliceTricks] golang slice tricks #go

Since the introduction of the append built-in, most of the functionality of the container/vector package, which was removed in Go 1, can be replicated using append and copy.

Here are the vector methods and their slice-manipulation analogues:

AppendVector

a = append(a, b...)

Copy

Repo

Haven't decided if I am going to submit code to it yet

Questions

👍 - Unlocked & Done 😊 - Locked & Done 🔒 - Locked & Not Done [] - Not yet Done

@mashingan
mashingan / sqlite3gorm.go
Last active March 4, 2025 00:25
Simple CRUD example working with Gorm
package main
import (
"fmt"
"net/http"
"strconv"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/sqlite"
"github.com/labstack/echo"
@480
480 / gist:3b41f449686a089f34edb45d00672f28
Last active February 17, 2026 20:54
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@peekg
peekg / MockRequestHandler.java
Created September 2, 2015 15:41
Test class for mocking HttpClient requests
class MockRequestHandler extends RequestHandler {
private GetMethod mockGetMethod;
private HttpClient mockHttpClient;
public MockRequestHandler(int responseStatus,
byte[] responseBody) throws HttpException, IOException,
SecurityException, IllegalArgumentException,
NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
@josephspurrier
josephspurrier / values_pointers.go
Last active May 15, 2025 14:43
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@denji
denji / http-benchmark.md
Last active February 13, 2026 10:16
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
export PATH="/usr/local/opt/python/bin:$PATH"
export GPG_TTY=$(tty)
# export START="$HOME/a"
# if [[ $PWD == $HOME ]]; then
# cd $START
# fi
# alias ls='ls -F --color --show-control-chars'