Skip to content

Instantly share code, notes, and snippets.

@bruteforks
bruteforks / atomic_habits.md
Created January 27, 2023 18:18 — forked from saikocat/atomic_habits.md
[Advice] Summary of Atomic Habits
View atomic_habits.md
@Nama
Nama / sway_workspaces.py
Last active January 27, 2023 18:54
Restore workspaces in sway to displays and move applications to saved workspaces. Maintained in its own repo now: https://github.com/Nama/sway-workspaces
View sway_workspaces.py
#!/usr/bin/python
'''
* setup displays first, e.g. with wdisplay
* run after setting up your displays `python sway_workspaces.py save <profilename>`
* repeat for every display setup
* setup kanshi and make it run `python sway_workspaces.py load <profilename>`
Multiple windows of an application/class aren't handled. No idea how to do so.
Had to alter the default tree, so the outputs are not the ports.
View pr.yml
name: Pull Request into Master, Develop and Preprod
on:
pull_request:
branches:
- "master"
- "develop"
- "preprod"
jobs:
@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active November 26, 2023 07:22
Setup Webpack with Tailwind CSS
View tailwind-webpack-setup.md

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

@pschmitt
pschmitt / sway-maximize.sh
Last active November 2, 2023 00:30
sway ipc script to maximize the currently focused window
View sway-maximize.sh
#!/usr/bin/env bash
usage() {
echo "Usage: $(basename "$0") [-d DEFAULT_BORDER_PX] [-m MAXIMIZED_BORDER_PX]"
}
get_waybar_height() {
# Waybar's config is JSONC, ie it contains comments. We need to strip
# these for jq.
grep -v '//' ~/.config/waybar/config | jq -er '.height'
View amplify getting started
lambda function
----
exports.handler = async (event) => {
console.log(event)
const customerId = event.pathParameters.customerId;
const customer = {'customerId': customerId, 'customerName': "Customer " + customerId };
const response = {
statusCode: 200,
// Uncomment below to enable CORS requests
headers: {
@eloylp
eloylp / Fedora35Hibernation.md
Last active November 5, 2023 16:55
Fedora 35 hibernation with swapfile, only for hibernation and resume
View Fedora35Hibernation.md

Fedora35 hibernation

This guide helps to configure the hibernation on a default Fedora35 (also worked fine in previous Fedora34) installation by using a swap file. The Fedora35 installation comes with btrfs as default filesystem. Also, it comes with a zram swap device:

$ swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   8G   0B  100
@saikocat
saikocat / atomic_habits.md
Last active May 31, 2023 21:19
[Advice] Summary of Atomic Habits
View atomic_habits.md
@mrousavy
mrousavy / MEMOIZE.md
Last active November 20, 2023 10:43
Memoize!!! 💾 - a react (native) performance guide
View MEMOIZE.md
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and  
returning the cached result when the same
inputs occur again.                                         
                                                     — wikipedia
@vcapretz
vcapretz / instagram-like-button.jsx
Created January 15, 2021 14:00
A simple Like button with a nice animation using react-native-reanimated v2, support for my post in https://vcapretz.com/2021/instagram-button-react-native
View instagram-like-button.jsx
import React from "react";
import Animated, {
useSharedValue,
withSpring,
useAnimatedStyle,
Extrapolate,
interpolate,
} from "react-native-reanimated";
import { Pressable, View, Button, StyleSheet } from "react-native";
import { MaterialCommunityIcons } from "@expo/vector-icons";