Skip to content

Instantly share code, notes, and snippets.

View adosib's full-sized avatar

Abdulah Sibalo adosib

View GitHub Profile
@chrisvoncsefalvay
chrisvoncsefalvay / example_file.html
Created September 27, 2016 21:29
Insert SVG as <object> in Django
{% load i18n static template_tags %}
<html>
<head>
<title>Hello, world!</title>
</head>
<body>
<h1>This is an SVG, inserted as an object.</h1>
{% svgobject 'images/svg/test.svg' 'test-class-one' 'test-class-two' %}
</body>
@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.
@fphilipe
fphilipe / exclude.sql
Last active May 27, 2025 23:47
PostgreSQL EXCLUDE constraint
CREATE EXTENSION btree_gist;
CREATE TABLE room_reservations (
room_id integer,
reserved_at timestamptz,
reserved_until timestamptz,
canceled boolean DEFAULT false,
EXCLUDE USING gist (
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH &&
) WHERE (not canceled)