Skip to content

Instantly share code, notes, and snippets.

View sdbondi's full-sized avatar

Stan Bondi sdbondi

View GitHub Profile
@mbleigh
mbleigh / README.md
Last active September 25, 2020 04:26
Automate the deletion of old Firebase Hosting versions.

Firebase Hosting Version Cleanup

This is a simple utility script for cleaning up Firebase Hosting versions, leaving a specified number of versions remaining. This is primarily done to conserve storage usage, but may have other uses.

USE AT YOUR OWN RISK. NO WARRANTY IS PROVIDED. THIS SCRIPT DOES DELETE STUFF PERMANENTLY

Usage

node cleanupVersions.js [commit]

@Techcable
Techcable / varint.py
Last active August 24, 2023 08:55
Command Line Varint Decoder/Encoder Tool
from typing import Iterable
from argparse import ArgumentParser
from sys import exit
parser = ArgumentParser(description="Parses and dencodes protobuf varints")
parser.add_argument("mode", help="Whether to encode or decode")
parser.add_argument("num", help="The number to decode/encode")
args = parser.parse_args()
@brobertsaz
brobertsaz / serversetup.md
Last active July 6, 2020 08:56
Ubuntu 12.04 Ruby, Rails, Nginx, Unicorn

Ubuntu 12.04, Ruby, Rails, Nginx, Unicorn and git-deploy

In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.

Server Setup

  • Create new server
  • Login to new server
    • ssh root@IPaddress (you can also use the domain name if you have the DNS setup already)
    • accept the RSA key
@terryjray
terryjray / gist:3296171
Created August 8, 2012 15:55
Enabling hstore for new postgresql 9.1 and rails 3 install on ubuntu 12.04
RAILS_ENV=production rake db:setup
# produces the error below.....hmmm.....it's a no-worky
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory
# hstore postgresql extension needs to be installed, so....
sudo apt-get install postgresql-contrib
# now your extension should be available to enable so log in with psql
psql -d yourproject_production -U yourdbuser -W
@larrybotha
larrybotha / A.markdown
Last active December 28, 2022 19:00
Monokai Sidebar Theme | Sublime Text

Sublime Text Monokai Sidebar Theme

A theme for the sidebar in Sublime Text to match the workspace of the Monokai theme.

This theme only modifies the sidebar to better match the Monokai theme, without modifying any of the styling elsewhere defined by Monokai.

File location: Packages/User

For a theme that extends beyond just the sidebar, visit https://gist.github.com/umpirsky/5842174

@d11wtq
d11wtq / deliver_email_job.rb
Created August 28, 2011 04:14
Customizing ActionMailer delivery methods
# Resque job to do the true outbound sending
class DeliverEmailJob
include ProjectName::Job::Logging
@queue = :mail_queue
def self.perform(args)
message = QueuedEmail.get!(args["message_id"])
logger.info("Delivering (%s) to %s" % [message.subject, message.formatted_recipient])
@dnagir
dnagir / deploy.rb
Created May 18, 2011 14:55
Flexible Rails deployment with Capistrano and Nginx
set :domain, ENV["domain"]
set :application, domain
set :user, ENV["user"]
set :destination, ENV["destination"] || domain
set :web_conf, ENV["web_conf"] || ENV["environment"] || 'production'
raise "please set domain=app.domain.name.com" unless domain
raise "please set user=server_username" unless user
set :port, ENV["port"] || 1234
set :repository, "."