Skip to content

Instantly share code, notes, and snippets.

View hyshka's full-sized avatar

Bryan Hyshka hyshka

View GitHub Profile
@jmatsushita
jmatsushita / README
Last active July 16, 2024 10:30
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@bbqtd
bbqtd / macos-tmux-256color.md
Last active July 24, 2024 06:15
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@stevedya
stevedya / video-embed.js
Created February 22, 2019 21:32
Vue filter for youtube and vimeo embeds
Vue.filter('videoUrl', function (url) {
//youtube
if (url.includes('youtube') || url.includes('youtu.be')) {
//Get id
url = url.split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
let id = (url[2] !== undefined) ? url[2].split(/[^0-9a-z_\-]/i)[0] : url[0];
return 'https://www.youtube.com/embed/' + id
} else if (url.includes('vimeo')) {
var url = url.match(/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/i);
return 'https://player.vimeo.com/video/' + url[1]
@mynameisfiber
mynameisfiber / slack-term-teams
Created November 5, 2018 00:31
Launch slack-term for multiple teans in a tmux session
#!/bin/bash
_TMUX_NAME="slackterm"
function _startSlack() {
i=0
for config in $( ls ~/.slack-term/*.json ); do
if [[ "$i" -eq "0" ]]; then
TMUX="tmux new-session -d -s ${_TMUX_NAME}"
else
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

anonymous
anonymous / c201-kerngen.sh
Created July 30, 2017 04:25
export ARCH=arm
export CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi-
export KERNEL_SERIES=v4.13
export KERNEL_BRANCH=v4.13-rc1
export LOCALVERSION=
export MALI_VERSION=r19p0-01rel0
export MALI_BASE_URL=https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-midgard-gpu
export DTB_FILES="
@tadly
tadly / rofi-gpaste.sh
Last active May 16, 2022 07:17
rofi + gpaste
#!/usr/bin/env bash
#
# Use rofi to select an entry from gpaste
#
# Requirements:
# rofi, gpaste
#
line=`gpaste-client --oneline | \
rofi -dmenu -i -p gpaste -kb-custom-1 Ctrl+x $@`
@probonopd
probonopd / linux_fusion360.md
Last active May 21, 2024 07:40
Autodesk Fusion 360 on Linux

Autodesk Fusion 360 on Linux

In the Web Browser

Ubuntu, Fedora, openSUSE, CentOS, SUSE Linux Enterprise, Debian,... users can finally use Autodesk Fusion 360 in the Linux Browser now.

https://myhub.autodesk360.com

On Chromium 55.0.2843.0 I get NET::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED.

@victorono
victorono / remove_duplicates.py
Last active April 26, 2024 17:57
Django - remove duplicate objects where there is more than one field to compare
from django.db.models import Count, Max
unique_fields = ['field_1', 'field_2']
duplicates = (
MyModel.objects.values(*unique_fields)
.order_by()
.annotate(max_id=Max('id'), count_id=Count('id'))
.filter(count_id__gt=1)
)
@kritoke
kritoke / nixos_tips.txt
Last active November 11, 2021 19:51
Various Tips/Tricks and Install Tips for NixOS
Installing on a newer PC with GFI requires a little differen't partitioning. When you open up gparted or your favorite command line partition tool, you need to do the following:
Create a partition scheme that is GPT. Then create the first partition as FAT32 and make it 200 mb or larger, set the flags to boot and esp. Then create your main partition and if you want, a home partition and swap partition.
Next step is to partition the main os partition:
mkfs.ext4 -L nixos /dev/sda1
Mount the partition:
mount /dev/disk/by-label/nixos /mnt