Skip to content

Instantly share code, notes, and snippets.

@samwelkanda
samwelkanda / django_digitalocean.md
Created May 2, 2019 13:17
A step by step process of deploying a django project to digital ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@typokign
typokign / zoomsucks.md
Last active September 8, 2023 05:06
Zoom Sucks

Zoom Sucks

  • Zoom abuses the installer flow on MacOS to bypass permissions dialogs (source)
  • Zoom sends identifying device info to Facebook, even when users don't have a Facebook account (source) (fixed)
  • A bug in Zoom sent identifying information (including email addresses and profile pictures) of thousands of users to strangers (source)
  • Zoom claims that meetings are end-to-end encrypted in their white paper and marketing materials, but meetings are only encrypted in transit, and are available in plaintext to Zoom servers and employees. (source)
  • zoomAutenticationTool can be used to escalat
@jacobd
jacobd / taktech.js
Created October 30, 2023 17:40
taktech Web FM synth keyboard binding
// paste in the js console of https://www.taktech.org/takm/WebFMSynth/
const k1wwhich = { 65: 18, 83: 19, 68: 20, 70: 21, 71: 22, 72: 23, 74: 24, 75: 25, 76: 26, 186: 27, 222: 28, 87: 3, 69: 4, 84: 5, 89: 6, 85: 7, 79: 8, 88: 9, 221: 10 }, km = {}; const noteTable = [ new NoteTableItem(28, 0, 44, 110, 54), new NoteTableItem(89, 0, 44, 110, 56), new NoteTableItem(150, 0, 44, 110, 58), new NoteTableItem(233, 0, 44, 110, 61), new NoteTableItem(303, 0, 44, 110, 63), new NoteTableItem(386, 0, 44, 110, 66), new NoteTableItem(447, 0, 44, 110, 68), new NoteTableItem(508, 0, 44, 110, 70), new NoteTableItem(590, 0, 44, 110, 73), new NoteTableItem(660, 0, 44, 110, 75), new NoteTableItem(743, 0, 44, 110, 78), new NoteTableItem(804, 0, 44, 110, 80), new NoteTableItem(866, 0, 44, 110, 82), new NoteTableItem(0, 0, 9, 188, 52), new NoteTableItem(9, 0, 51, 188, 53), new NoteTableItem(60, 0, 51, 188, 55), new NoteTableItem(111, 0, 51, 188, 57), new NoteTableItem(162, 0, 51, 188, 59), new NoteTableItem(213, 0, 51, 188, 60), new
@codeinthehole
codeinthehole / decorators.py
Created February 7, 2013 16:39
Basic auth for Django snippet
import base64
from django.http import HttpResponse
from django.contrib.auth import authenticate
from django.conf import settings
def view_or_basicauth(view, request, *args, **kwargs):
# Check for valid basic auth header
if 'HTTP_AUTHORIZATION' in request.META:
@milesrichardson
milesrichardson / result.md
Created November 16, 2023 12:51
OpenAI generated this code from a UX mockup at https://makereal.tldraw.com/
We couldn’t find that file to show.
@andrew-nuwber
andrew-nuwber / README.md
Last active December 29, 2023 00:26
Namecheap DNS to zone file
@dschuetz
dschuetz / make_passbook.py
Created May 31, 2014 03:43
Simple hack to create Passbook .pkpass file
import sys, os.path, hashlib, re
import zipfile
import subprocess
from StringIO import StringIO
from io import BytesIO
#
# Passbook Hack
# David Schuetz
# 30 May 2014
@idleberg
idleberg / sublime-text-macos-context-menu.md
Last active February 20, 2024 09:37 — forked from vincentmac/sublime-text-osx-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@clayton
clayton / ffmpeg-install.sh
Created August 9, 2013 18:55
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm
#!/usr/bin/env bash
# https://code.google.com/p/chromium/issues/detail?id=226801
url='https://chromium.googlesource.com/chromium/src/net/+/master/http/transport_security_state_static.json?format=TEXT';
curl -#s "${url}" | \
base64 --decode | \
sed '/^ *\/\// d' | \
sed '/^\s*$/d' > hsts.json;