Skip to content

Instantly share code, notes, and snippets.

@pv8
pv8 / fix-venv.sh
Last active September 1, 2022 03:33
Fix virtualenv symlinks after upgrading python with Homebrew and running brew cleanup
#!/usr/bin/env bash
#
# Fix virtualenv symlinks after upgrading python with Homebrew and then running
# `cleanup`.
#
# After upgrading Python using Homebrew and then running `brew cleanup` one can
# get this message while trying to run python:
# dyld: Library not loaded: @executable_path/../.Python
# Referenced from: /Users/pablo/.venv/my-app/bin/python
# Reason: image not found
@wolever
wolever / .babelrc
Last active November 5, 2015 21:40
Adding Babel (ES6) to a legacy project being built with webpack
{
// Enable all the features, including `::`-binding (ex, `setTimeout(::this.foo, 1000)`)
"stage": 0
}
@mparke
mparke / base.js
Last active December 17, 2015 20:29
Backbone base view with Handlebars template rendering
App.Views.Base = Backbone.View.extend({
templateName: null,
render: function(){
var data;
if(this.templateName !== null){
if(this.model !== null){
data = this.model.toJSON()
@berkes
berkes / coding_guideline_helper.php
Created November 3, 2011 15:28
Purrfect Drupal Coding Guideline Helper: Completely randomise your array and object usage.
<?php
/**
* Usage
* $inconsistent_view_thingy = views_get_view("some_view_name");
* $more_inconsistent_view_thingy = rand_obj_or_array($inconsistent_view_thingy);
*/
function rand_obj_or_array($thing) {
$det = rand(0,2);