Skip to content

Instantly share code, notes, and snippets.

View bryanveloso's full-sized avatar

Bryan Veloso bryanveloso

View GitHub Profile
@bryanveloso
bryanveloso / vercel-monorepo.MD
Created April 10, 2021 18:27 — forked from clodal/vercel-monorepo.MD
Setting Up Vercel Monorepo

Vercel Monorepo

Why?

  1. Code sharing: xxx-web project can directly access files and variables in xxx-api project vice versa. No need for a private npm module (i.e. @onextech/ens-api) for code sharing.
  2. Integrated: Only 1 git repository to check-in to. No need to split across web and api, etc.

Benefits

  1. Linked dependencies (i.e. node_modules) via Yarn Workspaces
  2. Aliased imports (i.e. @app/web/src/*)
@bryanveloso
bryanveloso / brew-services.rb
Created December 8, 2011 09:39 — forked from lwe/brew-services.rb
External script for homebrew to simplify starting services via launchctl, out of the box support for any formula which implements #startup_plist. (This version fixes the deprecation warning raised on Formula.resolve_alias.)
#!/usr/bin/env ruby -w
# brew-services(1) - Easily start and stop formulas via launchctl
# ===============================================================
#
# ## SYNOPSIS
#
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

Campfire client

A simple campfire client similar to Propane for OSX.

Wanted Features

  • Ability to stay logged into multiple rooms with unread counts
  • Noise / notification when people mention my name or listed aliases (Kyle, kneath, etc)
  • Upload / paste in images
  • Username completion
@bryanveloso
bryanveloso / general_python_reqs.txt
Created March 19, 2010 09:34 — forked from toastdriven/general_python_reqs.txt
The Python packages I install globally.
cherrypy
coverage
Cython
python-dateutil
distribute
docutils
eventlet
fabric
greenlet
gunicorn
@bryanveloso
bryanveloso / pip.conf
Created March 10, 2010 21:15 — forked from jezdez/pip.conf
Sample pip configuration file.
[global]
default-timeout = 60
respect-virtualenv = true
download-cache = /tmp
log-file = /tmp/pip-log.txt
[install]
find-links =
http://pypi.pinaxproject.com
http://pypi2.pinaxproject.com
We couldn’t find that file to show.
"Memcached cache backend"
from django.core.cache.backends import memcached
from django.utils.encoding import smart_unicode, smart_str
MIN_COMPRESS_LEN = 150000
class CacheClass(memcached.CacheClass):
def add(self, key, value, timeout=None, min_compress_len=MIN_COMPRESS_LEN):
if isinstance(value, unicode):
#!/usr/bin/env python
"""
Run Django Tests with full test coverage
This starts coverage early enough to get all of the model loading &
other startup code. It also allows you to change the output location
from $PROJECT_ROOT/coverage by setting the $TEST_COVERAGE_OUTPUT_DIR
environmental variable.
"""
/* Use this to cause a function to fire no more than once every 'ms' milliseconds.
For example, an expensive mousemove handler:
$('body').mouseover(ratelimit(function(ev) {
// ...
}, 250));
*/
function ratelimit(fn, ms) {
var last = (new Date()).getTime();