Skip to content

Instantly share code, notes, and snippets.

@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
@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;
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 3, 2024 06:29
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@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
@stvhwrd
stvhwrd / website-dl.md
Last active March 13, 2024 17:05
Download an entire website for offline use with wget. Internal inks will be corrected so that the entire downloaded site will work as it did online.

The best way to download a website for offline use, using wget

There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.

First make a folder to download the websites to and begin your downloading: (note if downloading www.SOME_WEBSITE.com, you will get a folder like this: /websitedl/www.SOME_WEBSITE.com/)


STEP 1:

@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)
{
#!/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"]
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