Skip to content

Instantly share code, notes, and snippets.

@stvhwrd
stvhwrd / setup_tmux_zsh.sh
Last active July 9, 2020 04:20
Install tmux and zsh on a remote server without root
#!/usr/bin/env bash
# Connect to the server..
# ssh username@server_ip
mkdir ~/.local;
# Download source and build libevent
cd /tmp;
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz;
tar xvfz libevent-2.1.8-stable.tar.gz;
#!/usr/bin/python
# Title: Reddit Data Mining Script
# Authors: Clay McLeod
# Description: This script mines JSON data
# from the Reddit front page and stores it
# as a CSV file for analysis.
# Section: Python
# Subsection: Data Science
want=["domain", "subreddit", "subreddit_id" "id", "author", "score", "over_18", "downs", "created_utc", "ups", "num_comments"]
@stvhwrd
stvhwrd / wysiwyg.js
Created November 22, 2018 02:43
Turn webpage into WYSIWYG editor
/* Run this in console of dev tools in browser to make all text on rendered page editable (but retains style etc) */
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
@paralax
paralax / Makefile
Last active July 7, 2017 18:08
vtwebd - a very tiny web daemon that servers static content
all: vtwebd
request.o: request.c
gcc -g -O2 -c request.c
vtwebd.o: main.c
gcc -pthread -g -O2 -c main.c
vtwebd: vtwebd.o request.o
gcc -pthread -g -o vtwebd main.o request.o
anonymous
anonymous / gist:5575774
Created May 14, 2013 13:16
--
-- open currently active Chrome tab with Safari
-- forked from https://gist.github.com/3151932 and https://gist.github.com/3153606
--
property theURL : ""
tell application "Google Chrome"
set theURL to URL of active tab of window 0
end tell
if appIsRunning("Safari") then
@dmgerman
dmgerman / SQL-set-operations.org
Last active August 29, 2015 14:21
CSC370: SQL set operations

Set operations in SQL

First create some tables

\d
@scratchyourbrain
scratchyourbrain / C Program to Display Fibonacci Series
Created December 18, 2014 06:54
C Program to Display Fibonacci Series
#include <stdio.h>
int main()
{
int count, n, t1=0, t2=1, display=0;
printf("Enter number of terms: ");
scanf("%d",&n);
printf("Fibonacci Series: %d %d ", t1, t2); /* Displaying first two terms */
count=2; /* count=2 because first two terms are already displayed. */
while (count<n)
{