Skip to content

Instantly share code, notes, and snippets.

View mgutz's full-sized avatar

Mario Gutierrez mgutz

View GitHub Profile
@mgutz
mgutz / wayland-bar.py
Created May 9, 2023 22:35
How to create a Webview bar on wlroots (Hyprland).
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gdk, Gtk
gi.require_version("WebKit2", "4.0")
try:
gi.require_version("GtkLayerShell", "0.1")
@mgutz
mgutz / transparency.lua
Created October 3, 2022 06:31
AwesomeWM: Minimize background windows on max layout, fullscreen or maximized
local log = require("internal.log")
local awful = require("awful")
local gears = require("gears")
local function hide_rest(active)
if active.maximized or active.fullscreen then
return true
end
@mgutz
mgutz / gist:1e96a4b249333ea14c31a8c461ddd177
Created June 13, 2022 08:10
herbstluftwm transparency
Herbsluftwm transparency
@mgutz
mgutz / xfce-wm-switcher.sh
Last active December 11, 2021 21:00
Shell functions to set XFCE's window manager to i3 or built-in xfwm.
#!/bin/bash
#. Use i3wm
use-i3wm() {
# NOTE: specifies an i3 configuration tailored for XFCE. ie do not to run
# some daemons and bar as needed by a standalone i3 setup.
xfconf-query --channel xfce4-session \
--property /sessions/Failsafe/Client0_Command \
--type string --set i3 \
--type string --set '-c' \
@mgutz
mgutz / envoy.yml
Created January 30, 2021 05:42
ERR_INCOMPLETE_CHUNKED_ENCODING fix for envoy + next.js
# Using nextjs in development behind an envoy proxy? You will likely encounter `ERR_INCOMPLETE_CHUNKED_ENCODING`
# errors in the console. The firefox debugger goes bonkers and the panel doesn't render at all (Chrome browser works).
#
# HMR uses a streaming response and the envoy timeout must be disabled.
# add to .filter_chains[].filters[].typed_config.route_config.virtual_hosts[].routes[]
routes:
— match:
prefix: “/”
route:
@mgutz
mgutz / Antonyms.md
Created January 26, 2020 10:45 — forked from maxtruxa/Antonyms.md
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@mgutz
mgutz / colors.js
Last active May 30, 2019 09:05
svelte3 actions and getters using nested object store
import {readable, writable} from 'svelte/store';
// could be its own module
const util = {
_root: null,
// similar to createSelector but instead returns a reactive variable
createGetter(store, fn, initialData) {
return readable(initialData, set => {
store.subscribe(state => set(fn(state, this._root)));
@mgutz
mgutz / main.yaml
Created December 21, 2017 12:14
ansible script for i3
- name: install i3 and custom utils
become: yes
apt: pkg={{item}}
with_items:
- hsetroot
- i3
- rofi
- xsel
- rxvt-unicode-256color
Get scope of current file
```
atom.workspace.getActiveEditor().getGrammar().scopeName
```

How to setup your VMWare Fusion 6 images to use static IP addresses on Mac OS X

At Crush + Lovely, we use Railsmachine's Moonshine to automate the configuration of our servers. When writing our deployment recipes, VMWare Fusion's ability to take snapshots and rollback to these snapshots is a huge timesaver because it takes just seconds to roll a server image to it's original state.

When you're just configuring a single server, having a static IP address for your server image isn't too important, but when you're configuring multi-server setups, it can be useful to duplicate a number of server images and give each a static IP address so you can consistently deploy to them. While not documented well at all, it turns out that this is relatively easy to accomplish in four simple steps.

1. Determine the MAC address of your guest machine

Let's say you have a guest machine with the name ubuntu-lucid-lynx-base