Skip to content

Instantly share code, notes, and snippets.

View RhysC's full-sized avatar

Rhys Campbell RhysC

  • Perth; Australia
View GitHub Profile
@ericelliott
ericelliott / essential-javascript-links.md
Last active April 22, 2024 10:15
Essential JavaScript Links
@johnsheehan
johnsheehan / flask-keen.py
Last active October 8, 2015 00:07
automatically send flask requests to keen
from keen.client import KeenClient
keen = KeenClient(
project_id="123",
write_key="abc"
)
@app.before_request
def before_request():
if "/static/" in request.path:
return
@ferventcoder
ferventcoder / SublimePackages
Last active August 29, 2015 13:56
Sublime Packages Installed
These are the sublime packages I have installed
@jbogard
jbogard / PdfFilter.cs
Last active September 12, 2018 09:40
public class PdfFilter : Stream
{
private readonly Stream _oldFilter;
private readonly string _baseUrl;
private readonly MemoryStream _memStream;
public override bool CanSeek
{
get { return false; }
}
public class PdfModule : IHttpModule
{
public void Init(HttpApplication context)
{
context.PreRequestHandlerExecute += context_BeginRequest;
}
private void context_BeginRequest(object sender, EventArgs e)
{
var httpApplication = (HttpApplication) sender;
@ferventcoder
ferventcoder / Preferences.sublime-settings
Created December 8, 2013 15:55
SublimeText2 User Settings
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_size": 23.0,
"highlight_line": true,
"highlight_modified_tabs": true,
"hot_exit": false,
"ignored_packages":
[
@jhrr
jhrr / Functional Core, Imperative Shell
Last active January 8, 2018 16:11
Notes and links for ideas about Gary Bernhardt's "functional core, imperative shell"
http://www.infoq.com/presentations/Simple-Made-Easy
http://www.infoq.com/presentations/integration-tests-scam
http://blog.thecodewhisperer.com/2010/09/14/when-is-it-safe-to-introduce-test-doubles
http://youtu.be/yTkzNHF6rMs
http://pyvideo.org/video/1670/boundaries
http://skillsmatter.com/podcast/ajax-ria/enumerators
http://alistair.cockburn.us/Hexagonal+architecture
http://c2.com/cgi/wiki?PortsAndAdaptersArchitecture
http://www.confreaks.com/videos/977-goruco2012-hexagonal-rails
http://www.confreaks.com/videos/1255-rockymtnruby2012-to-mock-or-not-to-mock
@bradwilson
bradwilson / NameTaskReturningMethodAppropriately.cs
Last active December 15, 2015 11:09
FxCop rule to ensure that Task-returning methods are suffixed with 'Async'
using System.Runtime.CompilerServices;
using Microsoft.FxCop.Sdk;
namespace Tier3.FxCop.TaskRules
{
public class NameTaskReturningMethodAppropriately : BaseIntrospectionRule
{
public NameTaskReturningMethodAppropriately() :
base("NameTaskReturningMethodAppropriately",
"Tier3.FxCop.Rules",
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 23, 2024 19:14
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'