Skip to content

Instantly share code, notes, and snippets.

@manvijain06
manvijain06 / rts.py
Created May 26, 2015 09:41
This Python script is a basic RTS game, with a modified version of Lanchester's Square Law to calculate eventual attrition rates, as well as force sizes, for two opposing forces. It is adapted from a sample IronPython module, and works on CPython, Jython and other Python toolchains as well.
print 'RTS Simulator.'
# Import random numbers.
try:
# this should be the normal path if Python has access to the standard library.
import random
except:
# This is a fallback for IronPython when running wihtout access to the standard library
import _random as random
@scripting
scripting / wp.js
Created May 9, 2015 15:29
I wrote this app to convert an entire WordPress site to OPML. I thought it might go somewhere, but it didn't. Maybe the code will be of use to someone else someday, so here it is.
var myVersion = "0.43";
//last build 4/17/2014; 1:03:26 PM
var http = require ("http");
var AWS = require ("aws-sdk");
var s3 = new AWS.S3 ();
var urlpack = require ("url");
var xmlrpc = require ("xmlrpc");
@leonjza
leonjza / cache.py
Last active July 14, 2024 11:49
Simple SQLite Cache
#!/usr/bin/python
import os
import errno
import sqlite3
import sys
from time import time
from cPickle import loads, dumps
import logging
@myusuf3
myusuf3 / banal-apps.txt
Last active August 29, 2015 14:16
Merely gathering up a list of apps that people are tired of rolling their own constantly. I would love to hear what you guys would want built out once and for all.
- banal-signup (user management)
- banal-payments (cash money)
- banal-betalist (beta list hype tools)
@TwoLeaves
TwoLeaves / init.lua
Last active March 7, 2022 18:00
Hammerspoon config
--------------------------------------------------------------------------------
-- Unsupported Spaces extension. Uses private APIs but works okay.
-- (http://github.com/asmagill/hammerspoon_asm.undocumented)
spaces = require("hs._asm.undocumented.spaces")
-- Get output of a bash command
function os.capture(cmd)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()

Git Cheat Sheet

Commands

Getting Started

git init

or

@bobbygrace
bobbygrace / trello-css-guide.md
Last active September 27, 2025 06:29
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@jerodsanto
jerodsanto / Rakefile
Created January 10, 2015 16:51
A code dump showing how we generate "The Changelog Weekly" using the Trello API
require "rubygems"
require "bundler"
require_relative "lib/importer"
Bundler.setup
desc "Import from Trello board"
task :import do
Importer.new(File.dirname(__FILE__)).import ENV["ISSUE"]
end
@rodricios
rodricios / summarize.py
Last active November 18, 2020 17:21
Flipboard's summarization algorithm, sort of
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pip install networkx distance pattern
In Flipboard's article[1], they kindly divulge their interpretation
of the summarization technique called LexRank[2].

Small bag / wearing

  • Passport (+I-797B)
  • Hoodie
  • Bluetooth headphones
  • Surface
  • 3DS/Vita (+games for 3DS)
  • Nexus 9
  • Kindle