Skip to content

Instantly share code, notes, and snippets.

alias brewlist="brew leaves | xargs brew deps --include-build --tree"
# Install EasyEngine on Linux
wget -qO ee rt.cx/ee4 && sudo bash ee
@tinjaw
tinjaw / README.txt
Last active November 11, 2020 15:29
Oksana Chumak (IntelliJ)
Sep 29, 2020, 11:42 GMT+2
Hello,
The general steps are the following:
Start from package.json scripts start-renderer-dev, then start-main-debug.
Create a Attach to Node.js/Chrome run configuration with the port number 9223. Then start it with debugging.
chmod g-w /usr/local/share/zsh
chmod g-w /usr/local/share/zsh/site-functions
@tinjaw
tinjaw / plugin.php
Created August 18, 2020 20:57
A plugin for YOURLS to: Send a 302 (temporary) redirect instead of 301 (permanent) for sites where shortlinks may change
<?php
/*
Plugin Name: Always-302 Plugin
Plugin URI: https://gist.github.com/tinjaw/5da8ef61d91b73ca928256bb51200117
Description: Send a 302 (temporary) redirect instead of 301 (permanent) for sites where shortlinks may change
Version: 1.0
Author: Tinjaw
Author URI: https://github.com/tinjaw
*/
When you need to concatenate a list of strings, you can do this using a for loop by adding each element one by one. However, this would be very inefficient, especially if the list is long. In Python, strings are immutable, and thus the left and right strings would have to be copied into the new string for every pair of concatenation.
A better approach is to use the join() function as shown below:
```python
characters = ['p', 'y', 't', 'h', 'o', 'n']
word = "".join(characters)
print(word) # python
```
@tinjaw
tinjaw / move_packages.sh
Last active June 23, 2019 19:17 — forked from fredrike/move_packages.sh
Synology move packages to another volume
#!/bin/bash
# this script moves ALL packages from volume-x to volume-y
# For Synology DSM - tested with DSM6.1
if [ $# -lt 2 ]; then
echo "usage: $0 <from_vol> <to_vol>"
exit -1
fi
from_vol="$1"
@tinjaw
tinjaw / nbcamera.py
Created October 14, 2017 22:21
Naturebytes Camera to Hologram Nova
#!/usr/bin/python
# Naturebytes Wildlife Cam Kit | V1.07 (Pixel)
# Based on the excellent official Raspberry Pi tutorials and a little extra from Naturebytes
import RPi.GPIO as GPIO
import time
from subprocess import call
from datetime import datetime
import logging
@tinjaw
tinjaw / GameManager.cs
Created June 14, 2017 15:06
Companion Code for Blog Entry on Hexasphere
// ***********************************************************************
// Assembly : Testing Project
// Author : Chaim Krause
// Created : 05-26-2017
//
// Last Modified By : Chaim Krause
// Last Modified On : 05-30-2017
// ***********************************************************************
// <copyright file="GameManager.cs" company="Combat Coding">
// CC BY 4.0