Skip to content

Instantly share code, notes, and snippets.

@abo-abo
abo-abo / flycheck-ruff.el
Created February 20, 2023 21:01
Emacs ruff flycheck config
(require 'flycheck)
;; From https://github.com/flycheck/flycheck/issues/1974#issuecomment-1343495202
(flycheck-define-checker python-ruff
"A Python syntax and style checker using the ruff utility.
To override the path to the ruff executable, set
`flycheck-python-ruff-executable'.
See URL `http://pypi.python.org/pypi/ruff'."
:command ("ruff"
"--format=text"
@joeytwiddle
joeytwiddle / start-mongo-replset.sh
Last active August 31, 2023 16:51
Script to start a mongodb cluster with three shards, for MongoDB 3.4
#!/usr/bin/env bash
set -e
# This script will start three shards, a config server and a mongos, all on the current machine.
#
# It was written for Mongo 3.4, based on https://docs.mongodb.com/manual/tutorial/deploy-shard-cluster/
#
# This script is only for testing purposes. In production, you would run each of these servers on a different machine.
#
# If you do run this, please ensure that your machine has a few gigs of swap space. mongod indexes will happily
@kirankulkarni
kirankulkarni / vagrant_helpers.sh
Last active August 29, 2015 14:06
A set of helper functions to suspend/resume your vagrant boxes from shellscript
#!/bin/bash
function vagrant_get_status()
{
cd "$1"
local status_op=$(vagrant status --machine-readable)
echo "$status_op" | while read line
do
local status_line=(${line//,/ })
local vagrant_type=${status_line[2]}
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 4, 2024 13:00
Backend Architectures Keywords and References
@ChrisTM
ChrisTM / throttle.py
Created June 21, 2013 21:33
Python decorator for throttling function calls.
class throttle(object):
"""
Decorator that prevents a function from being called more than once every
time period.
To create a function that cannot be called more than once a minute:
@throttle(minutes=1)
def my_fun():
pass
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 10, 2024 03:45
A badass list of frontend development resources I collected over time.
@olivier-m
olivier-m / pygit2.sh
Last active November 9, 2017 05:56
Install pygit2 in a Python VirtualEnv
#!/bin/sh
set -e
if [ "${VIRTUAL_ENV}" = "" ]; then
echo "Error: Not in a virtual env"
exit 1
fi
OS=$(uname -s)
@adamwiggins
adamwiggins / adams-heroku-values.md
Last active November 5, 2024 21:40
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@shanselman
shanselman / gist:5422230
Last active November 14, 2024 02:40
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@npryce
npryce / qc.py
Created November 3, 2012 10:00
QuickCheck for Python and Py.Test
def dicts(d):
keys, value_iters = zip(*d.items())
return (dict(zip(keys,values)) for values in zip(*value_iters))
def property(test_fn=None, tests=100):
def bind_parameters(test_fn):
arg_bindings = dicts(test_fn.__annotations__)
def bound_test_fn():
for args in itertools.islice(arg_bindings, tests):