-
Install uBlock Origin extension. (If you're not from US, check its options to turn on ad block lists for your country)
-
Do not install any other extensions ever! (exceptions: 1Password, Google Arts & Culture).
-
Create separate "people" for different activities: e.g. home, work, browsing sketchy websites. (Click on avatar > Manage People)
-
If you want to turn on sync, set up encryption passphrase. It's a separate passphrase from your Google account — your sync data will be encrypted locally with it before hitting Google servers.
-
Disable saving/auto fill of passwords, payment, and addresses. (https://twitter.com/Sc00bzT/status/1085521985017466881)
#include <windows.h> | |
#include <iostream> // Used for outputting info via 'cout' or 'cerr' to debug window | |
#include "resource.h" // Contains declarations of resources contained in resource file | |
void DestroyCaption(HWND hwnd, int windowWidth, int windowHeight); // Used to remove window caption and size window to bitmap size | |
HRGN CreateRgnFromFile(HBITMAP hBmp, COLORREF color); // Function that accepts a bitmap with color keyed to transparency and defines a region according to non transparent area | |
typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hWnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags); // Get a function pointer | |
lpfnSetLayeredWindowAttributes SetLayeredWindowAttributes; // Set instance of function pointer |
// | |
// Basic instrumentation profiler by Cherno | |
// Usage: include this header file somewhere in your code (eg. precompiled header), and then use like: | |
// | |
// Instrumentor::Get().BeginSession("Session Name"); // Begin session | |
// { | |
// InstrumentationTimer timer("Profiled Scope Name"); // Place code like this in scopes you'd like to include in profiling | |
// // Code | |
// } |
Python
#ifndef RANGE_HPP_ | |
#define RANGE_HPP_ | |
template<typename T> class RangeIterator; | |
template<typename T> | |
class Range | |
{ | |
T _start, _end, _step; |
# LVDB - LLOOGG Memory DB | |
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com> | |
# All Rights Reserved | |
# TODO | |
# - cron with cleanup of timedout clients, automatic dump | |
# - the dump should use array startsearch to write it line by line | |
# and may just use gets to read element by element and load the whole state. | |
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands. | |
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump! |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
This is a script to export bookmarks from the web browser Google Chrome to a users home drive in a Windows environment with clients and domain controllers. Most of the script comes from this article
- Double-click on the bat-file.
- Go the home drive on the users new computer.
- Double-click on openChromeFolder.bat which will take you to the chrome directory on that machiene.
- Copy the file Bookmarks to the newly opened window.
using System; | |
using System.Linq; | |
namespace FakeJobInfo | |
{ | |
class Program | |
{ | |
private static Func<int, int> rand = new Random().Next; |