Skip to content

Instantly share code, notes, and snippets.

View s-oram's full-sized avatar

Shannon Matthews s-oram

View GitHub Profile
@s-oram
s-oram / nginx.conf
Created March 24, 2025 23:57 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
#!/bin/sh
# Usage:
# To bootstrap your machine with piku:
#
# ssh root@YOUR-MACHINE-IP
# ./piku-bootstrap install
# exit on error
set -e
@s-oram
s-oram / project-create.sh
Created June 14, 2024 09:55 — forked from francoisromain/project-create.sh
A bash script to create a Git post-receive hook to deploy after a Git push
#!/bin/bash
# source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3
# and another script to delete the directories created by this script
# project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb
# Call this file with `bash ./project-create.sh project-name`
# - project-name is mandatory
# This will creates 4 directories and a git `post-receive` hook.
#! /bin/bash
######################################################################
#
# This script generates an SSL certficate for local development. To
# execute the script, run `bash create-dev-ssl-cert.sh`. Sudo is
# needed to save the certificate to your Mac KeyChain. After the cert
# is generated, you can use `HTTPS=true yarn start` to run the web
# server.
#
@s-oram
s-oram / inline-svg-function.scss
Created September 16, 2020 02:36 — forked from JacobDB/inline-svg-function.scss
Inline SVG function [SASS]
// Replace letters
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
}
@s-oram
s-oram / index.html
Last active January 2, 2020 00:52
Type Scale
<h1>A Visual Type Scale (h1)</h1>
<h2>A Visual Type Scale (h2)</h2>
<h3>A Visual Type Scale (h3)</h3>
<h4>A Visual Type Scale (h4)</h4>
<h5>A Visual Type Scale (h5)</h5>
<h5>A Visual Type Scale (h5)</h5>
<h6>A Visual Type Scale (h6)</h6>
<p>A Visual Type Scale (p)</p>
<small>A Visual Type Scale (small)</small>
@s-oram
s-oram / index.ts
Last active July 3, 2019 06:05
Minimal, Reproducible Example
import express from 'express';
const router = express.Router();
router.param('userId', (req, res, next, userId) => {
next(userId.includes(':') ? 'route' : null);
});
router
.get('/users/:userId::action', async (req, res) => {
@s-oram
s-oram / GitHub-Forking.md
Created July 8, 2018 01:03 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

procedure Resample(SourceBuffer, DestBuffer: PSingle; const SourceSampleFrames, DestSampleFrames: integer);
const
MaxInputLength = 1024;
ReqTransBand = 3;
var
rsHandle : CR8BResampler;
SrcRate, DstRate : Double;
TempSrcBuffer, TempDestBuffer : array of Double;
PSrcBuffer, PDestBuffer : PR8BDouble;