Skip to content

Instantly share code, notes, and snippets.

ramsrib / allow_paste.js
Created September 7, 2020 21:27
allow paste using javascript
View allow_paste.js
var allowPaste = function(e){
return true;
document.addEventListener('paste', allowPaste, true);
ramsrib /
Created June 24, 2020 02:49 — forked from bendavis78/
A simple database backup / rotation / prune script
# for use with cron, eg:
# 0 3 * * * postgres /var/db/ foo_db
if [[ -z "$1" ]]; then
echo "Usage: $0 <db_name> [pg_dump args]"
exit 1
ramsrib /
Last active May 2, 2023 22:32 — forked from ambivalentno/
A form field to handle validation of image + svg in Django 3
import sys
import xml.etree.cElementTree as et
from io import BytesIO
from django.core.exceptions import ValidationError
from django.core.validators import (
from django.forms import ImageField as DjangoImageField
ramsrib /
Created April 28, 2018 00:17 — forked from asamaraw/
Distributed JDBC session store for Dropwizard 1.2.2
public void run(TestDropwizardConfiguration configuration, Environment environment)
throws Exception
env.lifecycle().addLifeCycleListener(new AbstractLifeCycleListener()
public void lifeCycleStarting(LifeCycle event)
if (!(event instanceof Server))
def solve(rest, boards, counts):
if boards == []:
return rest == 0
board = boards[-1]
count = rest / board
rest = rest % board
while count >= 0:
if solve(rest, boards[0:-1], counts):
ramsrib / setup port forwarding to enable remote debugging in vagrant Getting the remote debugger to work with a java process running in a vagrant vm
View setup port forwarding to enable remote debugging in vagrant

Vagrant vm network config

In the Vagrantfile, do :

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network. :public_network
View Tensorflow for Poets.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ramsrib /
Last active November 25, 2017 21:18 — forked from btroncone/
A Comprehensive Introduction to @ngrx/store - Companion to Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

ramsrib / gist:c955024315555fea2fa12885aa7307f4
Created December 12, 2016 19:39 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos
View gist:c955024315555fea2fa12885aa7307f4

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{}
  5. Greg Young's [Unshackle Your Domain]{}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
ramsrib /
Created November 6, 2015 12:25 — forked from craSH/
A simple example Java class to safely generate and verify bcrypt password hashes for use in authentication systems.
* Author: Ian Gallagher <>
* This code utilizes jBCrypt, which you need installed to use.
* jBCrypt:
public class Password {
// Define the BCrypt workload to use when generating password hashes. 10-31 is a valid value.
private static int workload = 12;