Skip to content

Instantly share code, notes, and snippets.

View wesvetter's full-sized avatar
coffee plz

Wes Vetter wesvetter

coffee plz
View GitHub Profile
@andrewculver
andrewculver / prod.rb
Last active April 4, 2019 11:27
Change Mac OS X Terminal.app background color in a shell script using AppleScript.
#!/usr/bin/env ruby
# NOTE: this requires actually setting up a terminal profile called "Prod".
# TODO i have no idea if this is good enough, sorry.
def escape_for_applescript(string)
string.gsub("\"", "\\\"")
end
def execute_applescript(applescript)
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
"""
Logical deletion for Django models. Uses is_void flag
to hide discarded items from queries. Overrides delete
methods to set flag and soft-delete instead of removing
rows from the database.
"""
from django.apps import apps
from django.contrib.admin.utils import NestedObjects
from django.db import models
from django.db.models import signals
@romdim
romdim / datepicker.coffee
Last active October 5, 2018 21:34 — forked from kdimatteo/datepicker.js
Backbone-Forms implementation of Bootstrap DatePicker
###*
# Bootstrap Datepicker for Backbone.Forms
#
# Quick editor to create a Bootstrap style datepicker (instead of multiple of dropdowns)
# @see: https://github.com/eternicode/bootstrap-datepicker/
# @usage: takes 5 optional schema options: format, minViewMode, autoclose, clearBtn and endDate
# Forked because I wanted to use only years as shown in the example below
schema:
MyDate:
type: "DatePicker"
@ovcharik
ovcharik / grunt-browserify-persistent-cache.coffee
Last active May 4, 2016 20:18
Persistent cache for grunt browserify
fs = require 'fs'
# Structure of cache file:
#
# {
# "path/to/output/file/1": {
# "cache": {
# "path/to/source/file/1": {
# "size" : <file size>,
# "mtime": <file modified time in ms>,
@fredbenenson
fredbenenson / kickstarter_sql_style_guide.md
Last active April 2, 2024 15:19
Kickstarter SQL Style Guide
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 6, 2024 07:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

How do I do this thing?

I'm not aware of how to use Google, how do I do this basic thing in Language X?

tagged coding, question

edited by Grammar Nazi (2.5M), asked by 1337z0r (2)

Answer 1 (12)

  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
@marteinn
marteinn / external_tastypie_serialization.py
Last active August 29, 2015 14:00
How to use Tastypies resource serialization outside the api
"""
Credit to the parker library (https://github.com/coxmediagroup/parker/) and their TastyPieHandler.
"""
req = HttpRequest()
resource = YourResource()
bundle = resource.build_bundle(obj=your_model)
bundle = resource.full_dehydrate(bundle)
bundle = resource.alter_detail_data_to_serialize(req, bundle)