Skip to content

Instantly share code, notes, and snippets.

View vividvilla's full-sized avatar

Vivek R vividvilla

View GitHub Profile
@vividvilla
vividvilla / gist:bdab68fd89a53ae9d8c1431d43060956
Created September 30, 2022 10:48
Element gruvbox custom 1
{
"name": "Gruvbox custom 1",
"is_dark": true,
"colors": {
"accent-color": "#bd93f9",
"primary-color": "#fe8019",
"warning-color": "#fb4934",
"sidebar-color": "#282828",
"roomlist-background-color": "#1d2021",
"roomlist-text-color": "#a89984",
@vividvilla
vividvilla / element-gruvbox-custom.json
Created September 30, 2022 10:44
element-gruvbox-custom
{
"name": "Gruvbox custom",
"is_dark": true,
"colors": {
"accent-color": "#bd93f9",
"primary-color": "#fe8019",
"warning-color": "#fb4934",
"sidebar-color": "#282828",
"roomlist-background-color": "#1d2021",
"roomlist-text-color": "#a89984",
@vividvilla
vividvilla / element-test.css
Last active September 30, 2022 10:38
element-test-theme
{
"name": "Gruvbox",
"is_dark": true,
"colors": {
"accent-color": "#bd93f9",
"primary-color": "#fe8019",
"warning-color": "#fb4934",
"sidebar-color": "#282828",
"roomlist-background-color": "#1d2021",
"roomlist-text-color": "#a89984",
@vividvilla
vividvilla / element-no-bs.json
Last active September 30, 2022 10:35
No bullshit theme for Element web
{
"name": "No bs theme",
"is_dark": false,
"colors": {
}
}
@vividvilla
vividvilla / ca.md
Created January 31, 2022 06:47 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@vividvilla
vividvilla / custom_time.go
Created June 10, 2021 07:01 — forked from lummie/custom_time.go
Golang custom date / time formats when marshalling to JSON
// CustomTime provides an example of how to declare a new time Type with a custom formatter.
// Note that time.Time methods are not available, if needed you can add and cast like the String method does
// Otherwise, only use in the json struct at marshal/unmarshal time.
type CustomTime time.Time
const ctLayout = "2006-01-02 15:04:05 Z07:00"
// UnmarshalJSON Parses the json string in the custom format
func (ct *CustomTime) UnmarshalJSON(b []byte) (err error) {
@vividvilla
vividvilla / osxtweaks
Created January 8, 2020 10:45 — forked from webdevbrian/osxtweaks
Brian's List of OSX Tweaks for web developers
#OSX Tweaks:
===========
- Most need reboot to show changes
- Most of these tweaks are just for speed, but some are specific for development
- All of these are to be ran in terminal. The commands to be copy and pasted start after the less-than sign.
- I'm not responsible for any adverse effects to your computer, at all.
##Increase the speed of OS X dialogs boxes:
@vividvilla
vividvilla / migrate-fish-history-to-zsh.py
Created December 26, 2019 06:57 — forked from mateuspontes/migrate-fish-history-to-zsh.py
Migrate fish history to zsh shell (python 2.7)
import os
import re
def fish_to_zsh(cmd):
return (cmd.replace('; and ', '&&')
.replace('; or ', '||'))
with open(os.path.expanduser('~/.zsh_history.test'), 'a') as o:
with open(os.path.expanduser('~/.local/share/fish/fish_history')) as f:
for line in f:
@vividvilla
vividvilla / nginx.conf
Created November 28, 2018 10:07
Nginx POST and GET request serve static JSON
server {
listen 9999;
# This is the key.
error_page 405 =200 $uri;
location /test {
add_header 'Content-Type' 'application/json' always;
alias /Users/me/abc.json;
}
}
@vividvilla
vividvilla / simplesessions_callbacks.go
Created October 1, 2018 20:34
Callbacks for simplesession
func getCookie(name string, r interface{}) (*http.Cookie, error) {
rd := r.(*http.Request)
cookie, err := rd.Cookie(name)
if err != nil {
return nil, err
}
return cookie, nil
}
func setCookie(cookie *http.Cookie, w interface{}) error {