Skip to content

Instantly share code, notes, and snippets.

@joshfinnie
joshfinnie / mastodon_python.csv
Last active January 25, 2023 00:45
A CSV of Python people on Mastodon for easy import (major work done here: https://gist.github.com/samuelcolvin/1743d8919acb465c1fbbcea2c3cdaf3e)
Account address Show boosts Notify on new posts Languages
@dabeaz@mastodon.social true false
@tiangolo@fosstodon.org true false
@mitsuhiko@hachyderm.io true false
@simon@simonwillison.net true false
@nedbat@hachyderm.io true false
@mkennedy@fosstodon.org true false
@willmcgugan@mastodon.social true false
@pamelafox@fosstodon.org true false
@ambv@mastodon.social true false
(function(){ console.log("hacked!"); }());

Const for Hello World of ES2015 in Node Core

Example 1

const foo = "foo";
foo = "bar"; // should not assign
console.log(foo);
@joshfinnie
joshfinnie / request.py
Created December 30, 2015 16:30
Which one is better??
try:
response = requests.post(
"<URL>",
auth=(
os.environ.get('<USERNAME>'),
os.environ.get('<PASSWORD>')
),
data=json.dumps(payload))
except Exception as e:
# do something
@joshfinnie
joshfinnie / views.py
Created December 30, 2014 20:19
BreweryDB webhook example (Django)
import hashlib
from django.conf import settings
from django.core.exceptions import PermissionDenied
def webhook_receive(request):
"""
View used to receive webhooks from BreweryDB
"""
isValid = hashlib.sha1(settings.BREWERYDB_API_KEY + request.GET['nonce']) == request.GET['key']

Omid,

My name is Josh Finnie and I am one of the co-organizers of @NodeDC the local Washington DC meetup group. We have just wrapped up hosting a NodeSchool at the NationJS conference and it got us thinking we should make our meetup officially part of the NodeSchool community. When submitting for a chapter we were informed that one already exists and was setup by you. I am reaching out to see if we can assist in any way with the Washington DC chapter of NodeSchool. I personally run a monthly meetup called "Node Night" where we have routinely been hosting NodeSchool and would love to continue helping people learn Node.

Cheers,

Josh

import re
from django import template
from django.utils.encoding import force_unicode
from django.template.defaultfilters import stringfilter
CONSONANT_SOUND = re.compile(r'''
one(![ir])
''', re.IGNORECASE | re.VERBOSE)
VOWEL_SOUND = re.compile(r'''
[aeio]|
@joshfinnie
joshfinnie / nodeschool-prep.md
Last active August 29, 2015 14:08
NodeSchool Prep - NationJS 2014

NodeSchool - NationJS 2014

Welcome and thank you for signing up for NodeSchool at NationJS 2014. To make this NodeSchool the best NodeSchool, there are a few things that you can do before you arrive to be ready to excel at this NodeSchool!

Steps to get ready for NodeSchool

  1. Install Node.js - This can be done by choosing the pre-built installers here.
  2. After you've installed Node.js, install the NodeSchool workshops (see below).
  3. Come ready to learn with your favorite text editing program (We suggest Sublime Text, Atom or Brackets)
@joshfinnie
joshfinnie / gist:a7eb03a45f571ffc425d
Created October 3, 2014 17:20
Interesting way to inject underscore into Angular.js
var underscore = angular.module('underscore', []);
underscore.factory('_', function() {
return window._; //Underscore must already be loaded on the page
});
app.controller('MainCtrl', ['$scope', '_', function($scope, _) {
init = function() {
_.keys($scope);
}
init();
@joshfinnie
joshfinnie / gist:d028157a4ded7df3ad13
Created September 22, 2014 21:43
NodeSchool Mentor Get-together

@NodeDC, in conjunction with @NationJS are putting on a NodeSchool event the morning before the main conference. To make this a resounding success we need your help!

Come help others learn how to node! No need to be an expert, you just have to know a little more than someone else. First, register for the free NodeSchool Event on NationJS's website, then RSVP to this meetup.

This meetup will allow us to get the organization of the event in order and make sure everyone knows what being a mentor entails. Please bring a laptop with the NodeSchool modules installed so we can hit the ground running.