This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# Setup: | |
# Put this script in your path and make it executable. | |
# gem install nokogiri | |
# | |
# Usage: | |
# $ routes | grep index | |
require 'rubygems' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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)) |