Skip to content

Instantly share code, notes, and snippets.

@duonghuuphuc
duonghuuphuc / install-virtualenvwrapper-on-macos-10.15-and-later.md
Created June 12, 2022 08:12
Install virtualenvwrapper on macOS 10.15 and later

Install virtualenvwrapper on macOS 10.15 and later

At WWDC 2019 on June 3, 2019, starting with macOS Catalina (10.15), the macOS will use zsh as default shell across the operating system. Besides, Bash is still available along with the new zsh; however, by setting zsh as the default shell, Apple does force you to move to the new platform.

virtualenvwrapper is a set of extensions to the original virtualenv which is a tool for creating isolated virtual Python environments. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies. According to the virtualenvwrapper docs, there are some noteworthy features such as:

  • Organizes all your virtual environments in one place.
  • Wrappers for managing your virtual environments (create, delete, copy).
  • Use a single command to switch between environments.
@triwav
triwav / roku-proxy-setup.md
Created April 30, 2019 14:33
Roku Proxy Setup

This is largely based off of this article by Hulu and their roku-dev-cli tool.

Requirements:
The main requirement is a Mac with 2 available network interfaces WIFI <-> WIFI, LAN <-> WIFI, etc. This should work on other platforms as well but isn't covered here.

Setup
The first thing we need is Homebrew. If you've never used it before it's a great package manager for macOS that makes installing programs easier. Open Terminal and paste
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and hit enter

@laat
laat / tizen.sh
Last active December 14, 2024 14:59
Notes on Tizen commands that might work
sdb connect <ip>:<port> # connect to TV
sdb -s <deviceName> capability # get <installationPath>
# build
tizen cli-config "default.profiles.path=<profile_path>"
tizen build-web -out .buildResult -- <source-dir>
tizen package --type wgt --sign profileName -- <source-dir>/.buildResult # extract <package-file>
mv <package-file> .
rm -rf <source-dir>/.buildResult
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active December 29, 2024 07:04
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@paulirish
paulirish / what-forces-layout.md
Last active April 19, 2025 04:59
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active April 18, 2025 16:10
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@scottslowe
scottslowe / defined-virt-user-ssh-key
Created October 20, 2013 03:38
This Puppet code uses define-based virtual user resources to help manage user account on systems. This includes user's SSH keys as well as other properties.
define accounts::virtual ($uid,$realname,$pass,$sshkeytype,$sshkey) {
include accounts::params
# Pull in values from accounts::params
$homepath = $accounts::params::homepath
$shell = $accounts::params::shell
# Create the user
user { $title:
ensure => 'present',
@jamesstout
jamesstout / process.py
Last active July 12, 2021 07:24
add tz param to https://github.com/mwaterfall/alfred-datetime-format-converter to get the time in your location. Some testing done.
# -*- coding: utf-8 -*-
import alfred
import calendar
import time
import math
from delorean import utcnow, parse, epoch
# global var to see if user
# has a time offset
@g3d
g3d / gist:2709563
Last active January 9, 2025 17:35 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
@nuxlli
nuxlli / localstorage.js
Created November 2, 2011 15:28
Fallback to localStorage in Samsung Smart TV
/**
* Fallback to localStorage
**/
;(function() {
if (typeof localStorage == "undefined" && typeof FileSystem == "function") {
var fileSyObj = new FileSystem();
var fileName = curWidget.id + "_localStorage.db";
var lStorage = {};
var changed = false;