Skip to content

Instantly share code, notes, and snippets.

View bnvk's full-sized avatar

Brennan Novak bnvk

View GitHub Profile
import email
import json
import sys
import random
from matrix_client.api import MatrixHttpApi
html_template = (
"<b>From</b>: %(from)s\n"
"<b>To</b>: %(to)s\n"

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

on GET /notes
fetch the 20 most recent notes filtered by tag
show as h-feed
on GET /notes/new
the user must be an admin
show autofilled note-form
on GET /notes/{id}
fetch note
<?php
class ServiceHelper {
// @text is the full tweet text
// @shortCode is the code part of the shortlink, like nXXX0
public function shortenForTwitter($text, $shortCode=FALSE, $shortDomain=FALSE) {
$placeholders = array();
$rawTweet = $text;
@bnvk
bnvk / more-mute-regex.md
Created July 24, 2012 05:29 — forked from jimmynotjim/more-mute-regex.md
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.

##Simply annoying Tweets

Annoyingly extended words (4+ of the same letter in a phrase): OOOOHHHHMMMMYYYYGGGGOOOODDDD

([a-z])/1{4}

Tweet w/ just a single hashtag: #omgthissucks

^ *#[^ ]+$
@bnvk
bnvk / LICENSE.txt
Created November 8, 2011 05:06 — forked from aemkei/LICENSE.txt
Latitude Longitude Distance - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@bnvk
bnvk / LICENSE.txt
Created November 8, 2011 05:06 — forked from OiNutter/LICENSE.txt
Credit Card Validation similar to the Luhn Algorithm
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Will McKenzie<www.oinutter.co.uk>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
$url = 'https://github.com/socialigniter/blog/zipball/master';
$options = array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_FOLLOWLOCATION => 1,
);
$ch = curl_init($url);
@bnvk
bnvk / gist:825469
Created February 14, 2011 04:07 — forked from aaronpk/gist:825467
<?php
include('autoloader.php');
include('OAuth.php');
$googleOAuthConsumerKey = 'aaron.pk';
$googleOAuthConsumerSecret = 'XXXXXXXXXXXXXXXXXXXX';
$oAuthAccessTokenSecret = 'XXXXXXXXXXXXXXXXXXXXXXX';
$oAuthAccessToken = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';