Skip to content

Instantly share code, notes, and snippets.

View wotori's full-sized avatar
🦀
Fighting with the borrow checker

Wotori Movako wotori

🦀
Fighting with the borrow checker
View GitHub Profile
@sowwic
sowwic / Instructions.txt
Last active January 12, 2022 12:45
Ubuntu 20.04 - Maya 2020 installation
1)Get the packages required for converting the rpm package.
sudo apt-get install alien dpkg-dev debhelper build-essential zlib1g-dev
2)Get and install libXp6.
sudo add-apt-repository ppa:zeehio/libxp
sudo apt-get update
sudo apt-get install libxp6
3) Extract the contents of the Maya installation package and change directory to its install/Packages directory.
@uliang
uliang / states.py
Last active February 8, 2024 23:03
Implementation of State Design Pattern in python
"""
Simple implementation of a finite state machine.
Author: Tang U-Liang
Date: 2 Oct 2020
"""
import attr
from enum import Enum
import inspect
@peterhurford
peterhurford / install_xelatex_on_mac.txt
Last active June 5, 2024 04:46
How to install latex and xelatex on Mac so that Jupyter "Download as PDF" will work
brew install pandoc
brew tap homebrew/cask
brew install --cask basictex
eval "$(/usr/libexec/path_helper)"
# Update $PATH to include `/usr/local/texlive/2022basic/bin/universal-darwin`
sudo tlmgr update --self
sudo tlmgr install texliveonfly
sudo tlmgr install xelatex
sudo tlmgr install adjustbox
sudo tlmgr install tcolorbox
@rubo77
rubo77 / rotatescreen.sh
Last active August 1, 2023 17:16
This script rotates the screen (tested on a Lenovo Yoga 730-15iwl) (source: https://askubuntu.com/a/1217290/34298)
#!/bin/bash
# This script rotates the screen and touchscreen
# by Ruben Barkow-Kuder: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen device with `xinput`
TouchscreenDevice="$(xrandr |grep eDP|cut -d" " -f1)"
if [ "$1" = "--help" ] || [ "$1" = "-h" ] ; then
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@Gnzlt
Gnzlt / gourcevideo.sh
Created March 6, 2019 13:25
Gource video export command
#!/bin/bash
gource \
-s .03 \
-1280x720 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--key \
--highlight-users \
// Fill out your copyright notice in the Description page of Project Settings.
#include "LoaderBPFunctionLibrary.h"
#include "RuntimeMeshLoader.h"
#include <assimp/Importer.hpp> // C++ importer interface
#include <assimp/scene.h> // Output data structure
#include <assimp/postprocess.h> // Post processing flags
void FindMeshInfo(const aiScene* scene, aiNode* node, FReturnedData& result)
{
@simov
simov / README.md
Last active May 16, 2024 05:16
Run `node` scripts using `nvm` and `crontab` without hardcoding the node version

Run node scripts using nvm and crontab without hardcoding the node version

cronjob.env.sh

#!/bin/bash

# NVM needs the ability to modify your current shell session's env vars,
# which is why it's a sourced function
@MauricioMoraes
MauricioMoraes / access_postgresql_with_docker.md
Last active May 27, 2024 01:21
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

@kogcyc
kogcyc / heroku.sh
Created August 14, 2017 22:45
how to install the heroku cli on raspberry pi
wget https://cli-assets.heroku.com/branches/stable/heroku-linux-arm.tar.gz
mkdir -p /usr/local/lib /usr/local/bin
sudo tar -xvzf heroku-linux-arm.tar.gz -C /usr/local/lib
sudo ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku