Skip to content

Instantly share code, notes, and snippets.

View reubano's full-sized avatar

Reuben Cummings reubano

View GitHub Profile
@loziju
loziju / macosx-configure-postfix-as-relay.md
Last active May 4, 2024 23:51
Configure postfix as relay for OS X
<?php
/**
* Automatically alias Laravel Model's to their base classname.
* Ex: "App\Models\User" now can just be accessed by "User"
*/
if (! function_exists('aliasModels')) {
function aliasModels() {
$finder = new \Symfony\Component\Finder\Finder();
$finder->files()->name('*.php')->in(base_path().'/app');
@mjdietzx
mjdietzx / install-tesla-driver-ubuntu.sh
Last active December 23, 2023 11:03
Install TESLA driver for ubuntu 16.04
# http://www.nvidia.com/download/driverResults.aspx/117079/en-us
wget http://us.download.nvidia.com/tesla/375.51/nvidia-driver-local-repo-ubuntu1604_375.51-1_amd64.deb
sudo dpkg -i nvidia-driver-local-repo-ubuntu1604_375.51-1_amd64.deb
sudo apt-get update
sudo apt-get -y install cuda-drivers
echo "Reboot required."
anonymous
anonymous / index.html
Created November 10, 2016 10:31
Mithril Feed Reader mithriljs: rss feed reader // source http://jsbin.com/didolo
<!DOCTYPE html>
<html>
<head>
<script>
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
@rtpg
rtpg / Carmack Plan File Generator.ipynb
Created September 26, 2016 01:00
Carmack Plan File Generator
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
twisted async/await with asyncio reactor and uvloop
"""
import asyncio
import uvloop
from asyncio.tasks import ensure_future
try:
# as per github source the asyncio reactor is intended to be released in future version
@reubano
reubano / riko_readme.rst
Last active June 14, 2016 10:29
riko readme
@ndunn219
ndunn219 / sitemap_checker.py
Last active November 19, 2022 17:18
This code shows how to check a sitemap to make sure there are no links pointing to missing pages and to see if 301s are working correctly. It is explained at https://www.webucator.com/blog/2016/05/checking-your-sitemap-for-broken-links-with-python/
import requests
from bs4 import BeautifulSoup
sitemap = 'http://www.nasa.gov/sitemap/sitemap_nasa.html'
r = requests.get(sitemap)
html = r.content
soup = BeautifulSoup(html, 'html.parser')
links = soup.find_all('a')
@mnencia
mnencia / test1.py
Created April 16, 2016 08:35
pglogical decodin in python
from __future__ import print_function
import sys
import psycopg2
import psycopg2.extras
conn = psycopg2.connect(
'host=localhost user=postgres port=5495',
connection_factory=psycopg2.extras.LogicalReplicationConnection)
cur = conn.cursor()
replication_options = {
@wassname
wassname / Dockerfile
Last active November 30, 2022 08:56
Cache your pip wheels in docker using devpi, with graceful fails
# This code will use the devpi cache if it can be found
# otherwise fail with a few complaints
RUN export HOST_IP=$(ip route| awk '/^default/ {print $3}') \
&& mkdir -p ~/.pip \
&& echo [global] >> ~/.pip/pip.conf \
&& echo extra-index-url = http://$HOST_IP:3141/app/dev/+simple >> ~/.pip/pip.conf \
&& echo [install] >> ~/.pip/pip.conf \
&& echo trusted-host = $HOST_IP >> ~/.pip/pip.conf \
&& cat ~/.pip/pip.conf