Skip to content

Instantly share code, notes, and snippets.

@ethom7
ethom7 / MongoPOJO
Created November 10, 2016 21:48
Using Jackson and Mongo Java Driver to insert and retrieve a POJO from the MongoDB
// Person is a POJO, upload to db, retrieve from db
Person person = new Person();
person.setName("Evan Thompson");
person.setNickname("Unc");
ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally
@peteroupc
peteroupc / LineReader.js
Last active November 22, 2022 04:05
JavaScript class for reading files line by line in HTML5 apps
/*
Written by Peter O.
Any copyright to this work is released to the Public Domain.
In case this is not possible, this work is also
licensed under Creative Commons Zero (CC0):
https://creativecommons.org/publicdomain/zero/1.0/
*/
@unnikked
unnikked / RPN.java
Created March 25, 2015 18:00
Stack Based Virtual Machine. It uses RPN syntax.
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.Stack;
/**
@ahaas
ahaas / gist:3a91b2bba63808d3acf0
Created March 9, 2015 07:19
Go Stacks and Queues
// SOURCE: https://gist.github.com/moraes/2141121#comment-1361598
type Queue []*Node
func (q *Queue) Push(n *Node) {
*q = append(*q, n)
}
func (q *Queue) Pop() (n *Node) {
n = (*q)[0]
@renestalder
renestalder / README.md
Last active May 3, 2024 14:08
Unfollow all on Facebook

Facebook: Unfollow people and pages

See comments section for more up-to-date versions of the script. The original script is from 2014 and will not work as is.

  1. Open news feed preferences on your Facebook menu (browser)
  2. Click people or pages
  3. Scroll down (or click see more) until your full list is loaded
  4. Run the script in your browser console

Facebook will block this feature for you while you use it, depending on how much entities you try to unfollow. It automatically unblocks in a couple of hours and you will be able to continue.