Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env zsh
# Alias a 'cd' to all your ~/project directories on the command line with @<projectname>
# just type: @my_cool_project -- to 'cd' to '~/projects/my_cool_project'
# to install just add `source alias_projects.zsh` to your ~/.zshrc
PROJECTS_DIR=$HOME/projects
for dir in $(
ls -lta $PROJECTS_DIR |
grep ^d |
@wtask
wtask / Makefile
Last active May 9, 2021 18:45
Orchestrate the orchestrator with Makefile
description := "Generic development dependency runner"
comma := ,
ENV ?= dev
# You may set credentials for all services with this single session var
# Example:
# CREDENTIALS=micro-service make postgres
# OR under Windows:
# wsl CREDENTIALS=micro-service make postgres
CREDENTIALS ?= service
@gullyn
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 15, 2024 20:11
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@shaneutt
shaneutt / LICENSE
Last active May 14, 2024 15:02
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@walm
walm / main.go
Last active May 15, 2024 06:01
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@parmentf
parmentf / GitCommitEmoji.md
Last active May 22, 2024 09:54
Git Commit message Emoji
@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@mrzmyr
mrzmyr / app.js
Last active January 6, 2019 07:31
AngularJS – readmore directive
angular.module('app', [])
.filter('truncate', function () {
return function (text, length, end) {
if (isNaN(length)) {
length = 10;
}
if (end === undefined) {
end = '...';
@bign8
bign8 / config_sample.php
Last active August 29, 2015 13:56
An abstraction of PHP's PDO.
<?php
class config {
// For PHPMailer Class for sending email from forms and error reports
const defaultEmail = '';
const defaultFrom = '';
const notifyEmail = '';
const notifyName = '';
// For database connection scheme