Skip to content

Instantly share code, notes, and snippets.

@coderanger
coderanger / README.md
Last active August 18, 2023 18:33
How to patch Ubuntu for Heartbleed

How to patch Ubuntu for Heartbleed

  1. sudo apt-get update
  2. sudo apt-get install -y libssl1.0.0 openssl
  3. openssl version -a and confirm the "built on" date is >= 2014-04-07
  4. sudo lsof -n | grep ssl | grep DEL and restart all listed services.

Repeat #4 until no results are returned.

@JedWatson
JedWatson / KeystoneApiExample.md
Last active July 26, 2021 11:29
Example of how to scaffold API endpoints for Posts in a Keystone project (based on the yo keystone example).

This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.

It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)

Gists don't let you specify full paths, so in the project structure the files would be:

routes-index.js        -->    /routes/index.js         // modified to add the api endpoints
routes-api-posts.js    -->    /routes/api/posts.js     // new file containing the Post API route controllers
@ThomasBurleson
ThomasBurleson / e2eWithRealHTTP.js
Last active December 22, 2015 18:39
AngularJS testing with real $http calls. Angular-spec.js is a substitute for Angular-Mocks but it does not override $http with mocks.
angular.mock = { };
/**
*
*/
angular.mock.$RootElementProvider = function() {
this.$get = function() {
return angular.element('<div ng-app></div>');
}
};
@barneycarroll
barneycarroll / Location.es6.min.js
Last active August 24, 2018 09:36
An ultra-small URI parsing function that accepts a URI-like string & returns an object with all the string properties of the native Location object for that string. Works using native property detection, without received wisdom (ie dictionaries, inference, etc).
export default x=>document.createElement('a').href=x
@embray
embray / suggest_backports.py
Last active July 26, 2019 11:41
List pull requests merged since the last tag on the given release branch which have not yet been merged into the release branch.
#!/usr/bin/env python
# I wasn't happy with any of the GitHub libraries for Python that I tried so I
# just used the GitHub API directly. If someone would like to rewrite this
# using a library please be my guest
from __future__ import unicode_literals
import argparse
import base64
@cowboy
cowboy / Cowboy - Presentation.tmTheme
Created November 29, 2012 19:55
Sublime / TM theme I use for presentations.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Jacob Rus</string>
<key>comment</key>
<string>Created by Jacob Rus. Based on ‘Slate’ by Wilson Miner</string>
<key>name</key>
<string>Cowboy - Presentation</string>
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@cedricwalter
cedricwalter / example
Created January 18, 2012 21:52
Nginx configuration for JIRA, TeamCity, Nexus or any other Tomcat web application
## Server configuration for nginx to host Atlassian Jira / Jetbrain TeamCity or any other Tomcat web application
#
# author cedric.walter, www.waltercedric.com
# to be saved for ex in /etc/nginx/sites-available/example
server {
listen 80;
server_name jira.example.com;
access_log off;
location / {
@nrabinowitz
nrabinowitz / quantize.js
Created July 25, 2011 17:19
Javascript module for color quantization, based on Leptonica
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php