Skip to content

Instantly share code, notes, and snippets.

View ChrisRus's full-sized avatar
🧬
working on this thing called cell models...

Chris Russell ChrisRus

🧬
working on this thing called cell models...
View GitHub Profile
@ahmetb
ahmetb / gcrgc.sh
Last active May 10, 2024 15:17
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@dhavaln
dhavaln / Setup & Install
Last active September 1, 2024 23:14
Setting up HAProxy on Mac OSX
Install HAProxy from Homebre:
`brew install haproxy`
For full reference:
https://serversforhackers.com/load-balancing-with-haproxy
@scottpurdy
scottpurdy / impress.jsx
Created September 20, 2014 21:29
react-impress
/** @jsx React.DOM */
var RenderedDeck = React.createClass({
render: function() {
return <div id={this.props.id} className="deck" dangerouslySetInnerHTML={{__html:this.props.contents}}></div>;
}
});
var Deck = React.createClass({
render: function() {
@klovadis
klovadis / gist:5170485
Created March 15, 2013 15:03
A Lua script for Redis that allows you to set hash values based on a dictionary table
-- sets all fields for a hash from a dictionary
local hmset = function (key, dict)
if next(dict) == nil then return nil end
local bulk = {}
for k, v in pairs(dict) do
table.insert(bulk, k)
table.insert(bulk, v)
end
return redis.call('HMSET', key, unpack(bulk))
end
@klovadis
klovadis / gist:5170446
Created March 15, 2013 14:59
Two Lua scripts for Redis to turn HGETALL and HMGET into dictionary tables
-- gets all fields from a hash as a dictionary
local hgetall = function (key)
local bulk = redis.call('HGETALL', key)
local result = {}
local nextkey
for i, v in ipairs(bulk) do
if i % 2 == 1 then
nextkey = v
else
result[nextkey] = v
@klovadis
klovadis / gist:5170386
Created March 15, 2013 14:51
Lua script for redis to turn a dictionary table into a bulk reply
-- turns a dictionary table into a bulk reply table
local dict2bulk = function (dict)
local result = {}
for k, v in pairs(dict) do
table.insert(result, k)
table.insert(result, v)
end
return result
end
@christophermanning
christophermanning / README.mkd
Last active August 28, 2023 00:46
Hamiltonian Graph Builder
<style type="text/css">p {text-align:center;width: auto}</style>

Created by Christopher Manning

Gallery

Axle Eight Fibbobaci Florets [![Star]

@qbyt
qbyt / base64-conversion-coffeescript-compiled.js
Created January 12, 2011 15:46
A CoffeeScript port of the Javascript version by Nicholas C. Zakas(2009) - https://github.com/nzakas/computer-science-in-javascript
/*
Base 64 implementation in CoffeeScript (Compiled JS)
Converted from Base 64 implementation in JavaScript - Nicholas C. Zakas (2009)
(https://github.com/nzakas/computer-science-in-javascript)
*/
/*
Base64-encodes a string of text.
@param {String} text The text to encode.
@return {String} The base64-encoded string.