Skip to content

Instantly share code, notes, and snippets.

View motdde's full-sized avatar
🤿
Experementing

Oluwaseun Oyebade motdde

🤿
Experementing
View GitHub Profile
@BigglesZX
BigglesZX / Dreamhost.Python.installation.textile
Created January 14, 2012 10:49
Installing a custom version of Python on Dreamhost

Dreamhost supplies a fairly old version of Python in their shared hosting environments. It recently became necessary for me to use a newer version, and since this involved a bit of juggling, and since I’m also likely to forget how I did it, I thought I’d detail the steps here. These instructions should work with any Dreamhost shared hosting user, but follow them at your own risk.

The end result of this process is being able to run a current version of Python from your shared hosting user’s shell. It requires compiling, installing and running Python from your home directory rather than the system bin directories.

1. Create a helpful working directory
I chose to install all Python-related stuff in a python/ directory under my user’s home directory.

$ mkdir ~/python
$ cd ~/python
@singh1114
singh1114 / param_middleware.js
Last active January 25, 2021 20:11
Node.js middleware article
const validateParams = function (requestParams) {
return function (req, res, next) {
for (let param of requestParams) {
if (checkParamPresent(Object.keys(req.body), param)) {
let reqParam = req.body[param.param_key];
if (!checkParamType(reqParam, param)) {
return res.send(400, {
status: 400,
result: `${param.param_key} is of type ` +
`${typeof reqParam} but should be ${param.type}`
# Source: https://gist.github.com/764b402c8979678dfde01fd8f63c22e2
###########################################################
# Kustomize vs Helm #
# The Fight Between Templating and Patching in Kubernetes #
# https://youtu.be/ZMFYSm0ldQ0 #
###########################################################
# Links to referenced videos:
# - https://youtu.be/sUPkGChvD54
@jbub
jbub / squash-commits.sh
Created June 12, 2013 15:31
git squash last two commits into one
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
-- Window Function examples
-- PostgreSQL conference South Africa 2018
-- By Willem Booysen
-- Youtube: https://www.youtube.com/watch?v=blHEnrYwySE
-- Create database and templates for demo
DROP DATABASE IF EXISTS WindowFunctions;
CREATE DATABASE WindowFunctions;
@stepney141
stepney141 / BookmarkAPI_en.md
Last active April 4, 2023 01:45
(DEPRECATED) Twitter Undocumented Endpoints for Bookmark

Dropcap

Show the first letter of the first paragraph larger and in a different color than the rest of the text, using the ::first-letter selector.

A Pen by Nico Haemhouts on CodePen.

License.

@benjamingr
benjamingr / gist:0237932cee84712951a2
Last active October 6, 2023 08:31
Promise unhandled rejection tracking global handler hook

Possibly Unhandled Rejection NodeJS Promise Hook

###Unhandled Rejection Tracking

Several promise libraries such as bluebird and when as well as some native promise implementations offer potentially unhandled rejection tracking. This means that the following:

Promise.reject(new Error("err")); // never attach a `catch`
# Source: https://gist.github.com/48f44d3974db698d3127f52b6e7cd0d3
###########################################################
# Automation of Everything #
# How To Combine Argo Events, Workflows, CD, and Rollouts #
# https://youtu.be/XNXJtxkUKeY #
###########################################################
# Requirements:
# - k8s v1.19+ cluster with nginx Ingress
@mikepfeiffer
mikepfeiffer / gist:7c949e2d04c9e51ef204fb9a7f3d2978
Last active January 21, 2024 20:37
Userdata script to setup a basic web page with instance id and tag instance
#!/bin/bash
yum install httpd -y
/sbin/chkconfig --levels 235 httpd on
service httpd start
instanceId=$(curl http://169.254.169.254/latest/meta-data/instance-id)
region=$(curl http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
echo "<h1>$instanceId</h1>" > /var/www/html/index.html
aws ec2 create-tags --resources "$instanceId" --tags Key=Name,Value="PROD-$instanceId" --region "$region"