Skip to content

Instantly share code, notes, and snippets.

@jhasse
jhasse / main.cpp
Created May 25, 2011 10:18
SHA-1 With Boost
#include <iostream>
#include <boost/uuid/sha1.hpp>
void display(char* hash)
{
std::cout << "SHA1: " << std::hex;
for(int i = 0; i < 20; ++i)
{
std::cout << ((hash[i] & 0x000000F0) >> 4)
<< (hash[i] & 0x0000000F);
@Hexcles
Hexcles / stylish-font-replacement.css
Last active January 2, 2022 03:35
Font substitute CSS for web pages
/*
* Replace ugly Chinese bitmap fonts with system default sans-serif.
* ATTENTION: this will intentionally change the appearance of web pages!
* Most Chinese websites do not mean to use serif fonts, especially for these ugly ones.
*/
@font-face {
font-family: "宋体";
src: local("sans-serif");
}
@zhasm
zhasm / new_mac.md
Last active December 9, 2016 00:46
New Mac Configration
@zostay
zostay / README.txt
Last active October 18, 2022 05:03
Google Authentication Workflow for Pebble Watchapps
None of the workflow examples given in the Google Authentication OAuth2 documentation
(https://developers.google.com/accounts/docs/OAuth2) handle what's needed for Pebble. I
basically had to mix the needs of a client-side application with an offline web application
to get what's needed and work within the restrictions of the Pebble JS toolkit.
The steps are as follows:
1. Setup a Client ID for Web Application on the Google Developer Console
2. On the configuration web pages, with SSL:
* In the configuration page, use JavaScript to retrieve a authorization code, which
@tianyuf
tianyuf / baidu-as-a-network-utility.css
Created May 14, 2016 15:03
BaaN: Baidu as a Network Utility - 百度的实用主义方法论.
@-moz-document domain("baidu.com") {
body {
display: none;
}
html {
margin: 30px;
}
html::after {
@foolip
foolip / wpt-stats
Last active October 17, 2017 09:42
Also count servo exports
#!/bin/bash -e
for month in {2015,2016,2017}-{01,02,03,04,05,06,07,08,09,10,11,12}; do
# GNU date
nextmonth=`date +%Y-%m -d "$month-01 +1 month"`
# BSD date
#nextmonth=`date -j -f %Y-%m-%d -v+1m "$month-01" +%Y-%m`
commits=`git rev-list origin/master --no-merges --since $month-01T00:00:00Z --until $nextmonth-01T00:00:00Z --count`
chromium_exports=`git rev-list origin/master --no-merges --since $month-01T00:00:00Z --until $nextmonth-01T00:00:00Z --count --grep "^Change-Id:" --grep "^Cr-Commit-Position:"`
gecko_exports=`git rev-list origin/master --no-merges --since $month-01T00:00:00Z --until $nextmonth-01T00:00:00Z --count --grep "^Upstreamed from https://bugzilla\\.mozilla\\.org/"`