Skip to content

Instantly share code, notes, and snippets.

View maxdevjs's full-sized avatar
💭
╯︵ ┻━┻

maxdevjs maxdevjs

💭
╯︵ ┻━┻
View GitHub Profile
@maxdevjs
maxdevjs / env-examples.md
Created October 30, 2022 03:25 — forked from ericelliott/env-examples.md
env-examples

Most configuration really isn't about the app -- it's about where the app runs, what keys it needs to communicate with third party API's, the db password and username, etc... They're just deployment details -- and there are lots of tools to help manage environment variables -- not the least handy being a simple .env file with all your settings. Simply source the appropriate env before you launch the app in the given env (you could make it part of a launch script, for instance).

env files look like this:

SOMEVAR="somevalue"
ANOTHERVAR="anothervalue"

To source it:

$ source dev.env # or staging.env, or production.env, depending on where you're deploying to

@maxdevjs
maxdevjs / linux-full-desktop-container.md
Created July 9, 2022 18:35 — forked from morrolinux/linux-full-desktop-container.md
Run a full linux desktop in a container

In the following gist I'm going to guide you through the process of installing and booting an entire linux distribution with full desktop environment just like you would have with a classical VM, but with much better performance and much worse isolation :)

The reason why I did this was mainly because it's cool, but also to test new distros with decent graphics performance without actually booting them on my PC.

If you "try this at home" just keep in mind a container is not as secure as a VM, and some of the option we're going to explore will weaken container isolation from "a bit risky" to "totally unsafe" depending on what you choose.

Also, we're going to use systemd-nspawn for containers as it's probably the best fit for our use case and can also boot any linux partition without needing to prepare an apposite container image.

Less go!

@maxdevjs
maxdevjs / todo.py
Created September 26, 2021 08:42 — forked from ForgottenProgramme/todo.py
Todo Manager CLI tool (Python) Mahe Iram Khan
#!/usr/bin/env python
import sys
from datetime import datetime
HELP_MESSAGE = """/
Usage :-
$ ./todo add "todo item" # Add a new todo
$ ./todo ls # Show remaining todos
$ ./todo del NUMBER # Delete a todo
$ ./todo done NUMBER # Complete a todo
$ ./todo help # Show usage
@maxdevjs
maxdevjs / setup
Created July 27, 2021 16:19 — forked from ejpcmac/setup
Setup script for Phoenix projects using Nix and PostgreSQL
#!/bin/sh
echo
if [ ! -d "deps" ] || [ ! "$(ls -A deps)" ]; then
printf "\e[32m=> Fetching dependencies and building the application...\e[0m\n\n"
echo "+ mix do deps.get, compile --verbose"
mix do deps.get, compile --verbose
echo
fi
var emojis = [
'😄','😃','😀','😊','☺','😉','😍','😘','😚','😗','😙','😜','😝','😛','😳','😁','😔','😌','😒','😞','😣','😢','😂','😭','😪','😥','😰','😅','😓','😩','😫','😨','😱','😠','😡','😤','😖','😆','😋','😷','😎','😴','😵','😲','😟','😦','😧','😈','👿','😮','😬','😐','😕','😯','😶','😇','😏','😑','👲','👳','👮','👷','💂','👶','👦','👧','👨','👩','👴','👵','👱','👼','👸','😺','😸','😻','😽','😼','🙀','😿','😹','😾','👹','👺','🙈','🙉','🙊','💀','👽','💩','🔥','✨','🌟','💫','💥','💢','💦','💧','💤','💨','👂','👀','👃','👅','👄','👍','👎','👌','👊','✊','✌','👋','✋','👐','👆','👇','👉','👈','🙌','🙏','☝','👏','💪','🚶','🏃','💃','👫','👪','👬','👭','💏','💑','👯','🙆','🙅','💁','🙋','💆','💇','💅','👰','🙎','🙍','🙇','🎩','👑','👒','👟','👞','👡','👠','👢','👕','👔','👚','👗','🎽','👖','👘','👙','💼','👜','👝','👛','👓','🎀','🌂','💄','💛','💙','💜','💚','❤','💔','💗','💓','💕','💖','💞','💘','💌','💋','💍','💎','👤','👥','💬','👣','💭','🐶','🐺','🐱','🐭','🐹','🐰','🐸','🐯','🐨','🐻','🐷','🐽','🐮','🐗','🐵','🐒','🐴','🐑','🐘','🐼','🐧','🐦','🐤','🐥','🐣','🐔','🐍','🐢','🐛','🐝','🐜','🐞','🐌','🐙','🐚','🐠','🐟','🐬','🐳','🐋','🐄','🐏','🐀','🐃','🐅','🐇','🐉','🐎','🐐','🐓','🐕','🐖','🐁','🐂','🐲','🐡','🐊','🐫','🐪','🐆','🐈','🐩','🐾',
@maxdevjs
maxdevjs / workstationsetup.sh
Created February 24, 2020 07:01 — forked from JeremyMorgan/workstationsetup.sh
Setup for my FreeBSD Workstation
# This may be runnable as a script, but keep in mind -y is not always acknowledged.
# These are the drop dead basics
pkg -y install vim
pkg -y install git
pkg -y install chromium
pkg -y install gimp
pkg -y install sudo
# Install Rust
@maxdevjs
maxdevjs / gist:4856e68ff010f129b149eec955a6f730
Created February 5, 2020 20:26 — forked from Kardelio/gist:c6a01e1e927a75ef7f3af44ef79e7e35
Interactive Git Branch changer using fzf
git branch | fzf | sed 's/\* //g' | xargs -I '{}' git checkout {}
//reference code for solution of perfect Spiral:
//https://gist.github.com/chandeeland/b69156115e2b5842d83ca9eb3b2bbf2e
//failed trial:: https://gist.github.com/volfegan/e55decad6814e63fb450379c9bf13a61
//attempt to recreate: https://twitter.com/Borrachas/status/1204855395006763009
float a, b, x, y, d, h=600/2, r, s, shrink=0.94;
void setup() {
size(600, 600);
}
void draw() {
background(#EFF2D0);
@maxdevjs
maxdevjs / awmtt.sh
Created December 25, 2018 20:58 — forked from lanrat/awmtt.sh
run awesome in a nested window for testing
#!/usr/bin/env bash
# awmtt: awesomewm testing tool
#{{{ Usage
usage() {
cat <<EOF
awmtt [ start | stop | restart | -h | -e | -t [ get | change | list | random ] ] [ -C /path/to/rc.lua ] [ -D display ] [ -S windowsize ]
start Spawn nested Awesome via Xephyr
stop Stops Xephyr
@maxdevjs
maxdevjs / eastwood-custom.sh
Created December 1, 2018 07:39 — forked from Goles/eastwood-custom.sh
Zsh eastwood theme with basic git commit timer :)
# RVM settings
# if [[ -s ~/.rvm/scripts/rvm ]] ; then
# RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
# else
# if which rbenv &> /dev/null; then
# RPS1="%{$fg[yellow]%}rbenv:%{$reset_color%}%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$reset_color%} $EPS1"
# fi
# fi
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["