Skip to content

Instantly share code, notes, and snippets.

View jrumbut's full-sized avatar

Joshua Rumbut jrumbut

  • UMass Chan Medical School
  • Worcester, MA
View GitHub Profile
@axelbdt
axelbdt / django-postgresql-15.md
Last active November 12, 2024 17:36
# Django and PostgreSQL 15, the rules have changed

Django and PostgreSQL 15, the rules have changed

Postgres 15 is just out, and while there is a lot to love about this new release, you're in for a surprise if you try to set it up with Django following tutorials like this one.

The reason is stated in the release announcement:

Remove PUBLIC creation permission on the public schema (Noah Misch) The new default is one of the secure schema usage patterns that Section 5.9.6 has recommended...

Provided your web app doesn't access your database as a superuser (it shouldn't) and uses a dedicated user, it is not allowed to use the public schema anymore. You have to create one for this specific user, and the next section will

@jiahao
jiahao / nrules.svg
Last active May 17, 2022 08:30
What do .gitignore files tell us about the inherent complexity of programming languages? This gist can be run on data from GitHub's own collection of gitignore templates, whose repository is at https://github.com/github/gitignore, and counts how many rules are present in the template for each programming language.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pinetum
pinetum / read floating point number in binary file.R
Last active April 21, 2020 10:38
Read binary file in R (4byte float point)
path_binary_file <- "~/Dropbox/元智課程資料/研究所課程/資料探勘/VQ/COL.sil"
n_dimension <- 26
n_element_byte <- 4
#------read file-----
#create file connection
zz <- file(path_binary_file, "rb")
# calculate number of element bt file size
n_total_element <- file.info(path_binary_file)$size/n_element_byte
@primaryobjects
primaryobjects / nnet.R
Created March 28, 2016 19:53
Neural network (nnet) with caret and R. Machine learning classification example, includes parallel processing.
library(caret)
library(doParallel)
registerDoParallel(cores = 2)
# Read data.
data <- read.csv('train.csv')
test <- read.csv('test.csv')
# Set classification column to factor.
@vindia
vindia / droplet.css
Created August 13, 2012 12:13
CSS 3 Water Droplet
body { padding: 4em; }
#droplet {
background-color: lightblue;
width: 150px;
height: 150px;
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 75px;
-webkit-border-bottom-right-radius: 75px;
-webkit-border-bottom-left-radius: 75px;
-webkit-transform:rotate(45deg);
@meleyal
meleyal / optimize_images.rb
Created October 19, 2011 11:10
Simple png + jpg optimization script using optipng + jpegtran
#!/usr/bin/ruby
# Instructions
# - Install optipng + libjpeg (http://mxcl.github.com/homebrew/)
# - Put this file in a directory of images
# - Open in TextMate + run it (cmd+r)
# Config