Skip to content

Instantly share code, notes, and snippets.

@tadast
tadast / ssl_puma.sh
Last active January 21, 2025 16:20 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@himerzi
himerzi / Game of Life
Created March 20, 2014 17:06
The Game of Life in Clojure, and rendered in Quil
(ns game-of-life.core
(:require [quil.core :as q])
(:use overtone.at-at))
(defn game-func
"function taking a game state to the following game state"
[state]
nil)
@ka8725
ka8725 / gist:9419051
Created March 7, 2014 20:12
mailtatcher replacement
$ python -m smtpd -n -c DebuggingServer localhost:1025
This is how receiving email looks like:
---------- MESSAGE FOLLOWS ----------
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Subject: User activation - localhost:8000
From: [email protected]
# MODEL
class Case < ActiveRecord::Base
include Eventable
has_many :tasks
concerning :Assignment do
def assign_to(new_owner:, details:)
transaction do
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@davidzchen
davidzchen / sample-linux.c
Last active January 6, 2025 04:10
Sample C code using the Linux kernel coding style
/*
* Sample file using the Linux kernel coding convention.
*
* https://www.kernel.org/doc/Documentation/CodingStyle
*
* General rules:
* - Indents are tabs and must be 8 spaces wide.
* - Each line must be at most 80 characters long.
* - Use C-style comments.
* - File names should be lower-case.c
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@booleanbetrayal
booleanbetrayal / Gruntfile.js
Last active November 23, 2024 05:09
Example GruntJS configuration for a replacement to the Sprockets Rails asset pipeline
'use strict';
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var paths = {
@ka8725
ka8725 / model.py
Last active January 2, 2016 10:49
Oop model comparison Ruby and Python
from abc import ABCMeta
from random import randint
class SortableGoods(object):
__metaclass__ = ABCMeta
_GOODS_CLASSES_PRIORITY = {
'Person': 0,
'Container': 1,
def method1
end
def method2(default: 1)
end
method(:method1).arity # => 0
method(:method2).arity # => 0