Skip to content

Instantly share code, notes, and snippets.

@radmen
radmen / .htaccess
Created January 2, 2013 21:56
Wordpress lazy static site generator
RewriteEngine On
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI} -f
RewriteRule ^(.*)$ /static/$1 [L,QSA]
RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI}/index.html -f
RewriteRule ^(.*)$ /static/$1/index.html [L,QSA]
RewriteRule ^index\.php$ - [L]
@sweinberg
sweinberg / Geometry Notes Second Semester
Created June 26, 2013 17:27
My second semester Geometry notes and final exam study guide.
#Geometry Notes Second Semester
***
##Area, Surface Area and Volume
###Circumference
* Circumference is the linear distance around the outside of a circular object.
* C = π • d or π • 2r.
@bryanjclark
bryanjclark / adn-createStreamAndMonitor
Created November 9, 2013 23:17
I'm trying to build a Python-based push notification process. Eventually, I'll host it on a Mac or on AWS, and send out push notifications through there. Here's my current working copy (I'll update it occasionally) in trying to build that python service.
import time
import json
import requests
from pprint import pprint
# Here's what I want running on the server. For now, I'm running it on my local machine.
# FIRST, WE NEED AN APP TOKEN
appTokenURL = 'https://account.app.net/oauth/access_token'
clientID = 'MY_CLIENT_ID'
@banterability
banterability / battery.coffee
Last active January 14, 2016 00:37
Get iPhone battery life over time from Reporter App's (http://www.reporter-app.com/) logs in Dropbox
async = require 'async'
fs = require 'fs'
{filter, flatten} = require 'underscore'
OBJ_C_EPOCH = 978307200
DROPBOX_DIR = #"<path to your dropbox folder >/Dropbox/Apps/Reporter-App/"
fs.readdir DROPBOX_DIR, (err, files) ->
throw new err if err?
dataFiles = filter files, (filename) -> /.json/.test filename
@Zettt
Zettt / Daily Diary.py
Created November 19, 2012 19:28
Daily Diary in Python for Pythonista ( Original post: http://tmblr.co/ZFavEyXHGqSe )
import webbrowser
import urllib
dayone_url = "dayone://post?entry="
feeling_question = "How do you feel today?"
achievement_question = "What are you trying to achieve today?"
thought_question = "Is there a negative thought or positive on your mind you want to get out?"
tag = "#diary"
# input
@styledev
styledev / Parse Tweet Message to Link Entities
Last active March 24, 2016 16:24
This function will linkify your tweet messages from the Twitter API using include_entities=true
@AdrianoFerrari
AdrianoFerrari / tex-to-pdf
Created April 3, 2015 12:40
Node server to take Gingko Tex output into PDF
var TreeId = "your_tree_id_here";
var Filename = "output_filename";
var http =require('http');
var fs = require('fs');
var request = require('request');
var exec = require('child_process').exec;
var header = fs.readFileSync('parts/header.tex', 'utf8');
var footer = fs.readFileSync('parts/footer.tex', 'utf8');
var replacements = { '\\\\begin\\{center\\}\\\\rule\\{3in\\}\\{0\\.4pt\}\\\\end\\{center\\}': '\\hr', '\\\\section\{([^\}]*)\}\\\\label\{([^\}]*)\}\\n\\n([^\.]*[\\.\\\'\\\'\\?\\!]*)\\s': '\\finishchapter\n\\section{$1}\\label{$2}\n\\setupchapter\n\\newthought{$3} ' };
@hailiang-wang
hailiang-wang / index.html
Created November 29, 2014 08:04
ion-search directive with Ionic framework
<html ng-app="ionicApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Search directive example</title>
</head>
<body>
@kazekagegaara
kazekagegaara / Ionic-UL-search-example.markdown
Created January 14, 2015 21:50
Ionic UL search example
from flask import Flask, make_response
import matplotlib.pyplot as plt
import StringIO
import numpy as np
app = Flask(__name__)
@app.route('/plots/<f>')
def show_user_profile(f):