Skip to content

Instantly share code, notes, and snippets.

@reecer
reecer / waitForKeyElements.js
Created October 18, 2023 18:34 — forked from mjblay/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content. Forked for use without JQuery.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
//--- Page-specific function to do what we want when the node is found.
function commentCallbackFunction (element) {
element.text ("This comment changed by waitForKeyElements().");
@reecer
reecer / .zshrc
Created August 15, 2023 19:42 — forked from Anon-Exploiter/.zshrc
.zshrc of Kali Linux 2020.3 including the lit prompt
# ~/.zshrc file for zsh non-login shells.
# see /usr/share/doc/zsh/examples/zshrc for examples
setopt autocd # change directory just by typing its name
#setopt correct # auto correct mistakes
setopt interactivecomments # allow comments in interactive mode
setopt ksharrays # arrays start at 0
setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=expression’
setopt nonomatch # hide error message if there is no match for the pattern
setopt notify # report the status of background jobs immediately
@reecer
reecer / sp
Created December 27, 2017 00:41 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@reecer
reecer / System Design.md
Created April 19, 2016 18:00 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@reecer
reecer / .tmux.conf
Last active August 29, 2015 14:14 — forked from paulrouget/.tmux.conf
set -g default-terminal "screen-256color"
set -g status-utf8 on
bind M source-file ~/.tmux/mac.session
bind L source-file ~/.tmux/linux.session
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# THEME
set -g status-bg black

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Lesson 1: Affordances and Signifiers

Don't solve the problem given (as it's stated), figure out what the real underlying problem is.

To understand design, you have to be a good observer and question things. Travel with a camera and take photos. Don't use flash, use natural lighting when possible.

Affordances are the relationships (read: possible actions) between an object and an entity (most often a person). For example, a chair affords sitting for a human. Affordances enable interactions between entities and objects (similarly, anti-affordances prevent or reduce interactions). The presence of an affordance is determined by the properties of the object and of the abilities of the entity who's interacting with the object.

Signifiers are signals, communication devices. These signs tell you about the possible actions; what to do, and where to do it. Signifiers are often visible, but invisible (secret) signifiers do exist, like clicking a YT video to play

var util = require('util'),
EventEmitter = require('events').EventEmitter;
var Server = function() {
var self = this;
this.on('custom_event', function() {
self.logSomething('custom_event');
});
import websocket
import thread
import time
import sys
from urllib import *
class SocketIO:
def __init__(self):
self.PORT = 5000
self.HOSTNAME = '127.0.0.1'