Skip to content

Instantly share code, notes, and snippets.

View bkeating's full-sized avatar
🤙
Gettin’ SUM & CALCin’ out

Benjamin Keating bkeating

🤙
Gettin’ SUM & CALCin’ out
View GitHub Profile
@drodsou
drodsou / preact-htm-nobuild.html
Last active February 15, 2021 05:19
Preact-htm single page no build example
<!DOCTYPE html>
<html lang="en">
<title>htm Demo</title>
<body>
<h1>no build preact htm app here:</h1>
<div id="app"></div>
</body>
<script type="module">
// -- no build example of preact + htm, useful for small proof of concept
@jgreat
jgreat / docker.md
Last active January 13, 2020 16:45
Docker CE on RHEL 7.6

Install Prerequisite Packages

yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

Enable yum server-extras Repo

@nijicha
nijicha / install_nodejs_and_yarn_homebrew.md
Last active January 30, 2024 12:14
Install NVM, Node.js, Yarn via Homebrew
@gbaman
gbaman / graphql_example.py
Created November 1, 2017 00:18
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200:
@LowerDeez
LowerDeez / admin.py
Last active February 17, 2023 05:15
Django. Admin Tabular Inline initial data
from django.utils.functional import curry
class DetailsInline(admin.TabularInline):
model = Details
# formset = DetailsFormset
extra = 3
def get_formset(self, request, obj=None, **kwargs):
initial = []
if request.method == "GET":
@garmjs
garmjs / server.js
Last active July 29, 2022 17:16
Simple SSR React, React Router v4 and Helmet with express
require('babel-register')
const express = require('express')
const React = require('react')
const ReactDOMServer = require('react-dom/server')
const ReactRouter = require('react-router')
const ServerRouter = ReactRouter.ServerRouter
const App = require('./src/App').default
const path = require('path')
const Helmet = require('react-helmet')
const compression = require('compression')
atom-text-editor {
-webkit-font-smoothing: antialiased;
}
atom-text-editor::shadow{
.storage.type.function.arrow, .operator {
font-family: 'FiraCode-Retina';
text-rendering: optimizeLegibility;
vertical-align: baseline;
}
@cube-drone
cube-drone / automation.md
Last active March 26, 2024 20:24
Automation For The People

Automation for the People

Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.

"Don't Use Manual Procedures".

This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.

The trouble was that I hadn't much of an idea how to actually go

@druellan
druellan / opengraph.template.html
Created December 29, 2015 16:56
Basic template for OpenGraph/Facebook metatags
<html prefix="og: http://ogp.me/ns#">
<head>
<title>The Title</title> <!-- ˜60 chars -->
<meta name="description" content="The Description"> <!-- ˜150 chars -->
<meta property="og:title" content="The Title">
<meta property="og:description" content="The Description"> <!-- ˜300 chars -->
<meta property="og:site_name" content="Sfida Blog">
<meta property="og:locale" content="es_AR">
<meta property="og:type" content="website">
<meta property="og:url" content="http://www.sfidastudios.com">
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;