Skip to content

Instantly share code, notes, and snippets.

View brossetti1's full-sized avatar

Brian Rossetti brossetti1

View GitHub Profile
;; Stolen from Read-Eval-Print-Love by the inimitable Michael Fogus
(defmacro schemish (functions &body body)
`(macrolet ,(mapcar (lambda (function)
`(,function (&rest args)
`(funcall ,',function ,@args)))
functions)
,@body))
@kingcons
kingcons / basics.lisp
Last active December 25, 2015 00:59
Now with more stuff!
(defpackage :cl-basics
;; Clauses we're not using: import-from, export, shadow
(:use :cl))
(in-package :cl-basics)
(defvar *foo* "bar"
"A simple variable with docstring.")
(defun foo (bar)
@kingcons
kingcons / oo.lisp
Last active December 25, 2015 01:09
tweaks
(defpackage :lisp-oo
(:use :cl))
(in-package :lisp-oo)
(defclass content ()
((tags :initform nil :initarg :tags :accessor content-tags)
(slug :initform nil :initarg :slug :accessor content-slug)
(date :initform nil :initarg :date :accessor content-date)
(text :initform nil :initarg :text :accessor content-text)))
@maxivak
maxivak / readme.md
Last active January 12, 2024 06:53
Integrating Gem/Engine and Main Rails App
@satendra02
satendra02 / app.DockerFile
Last active July 12, 2024 02:39
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran:
@edolyne
edolyne / server.js
Created August 6, 2018 15:24
Dynamic Sitemap creation for NextJS based projects
const express = require('express');
const next = require('next');
const sm = require('sitemap');
const axios = require('axios');
const port = parseInt(process.env.PORT, 10) || 3000;
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();
@jamesgecko
jamesgecko / routes
Created July 11, 2019 19:38
Faster way to search Rails routes from the CLI
#! /usr/bin/env ruby
# Setup:
# Put this script in your path and make it executable.
# gem install nokogiri
#
# Usage:
# $ routes | grep index
require 'rubygems'