Skip to content

Instantly share code, notes, and snippets.

View alairock's full-sized avatar

Skyler Lewis alairock

View GitHub Profile
# First we need to get the modeline string for xrandr
# Luckily, the tool "gtf" will help you calculate it.
# All you have to do is to pass the resolution & the-
# refresh-rate as the command parameters:
gtf 1920 1080 60
# In this case, the horizontal resolution is 1920px the
# vertical resolution is 1080px & refresh-rate is 60Hz.
# IMPORTANT: BE SURE THE MONITOR SUPPORTS THE RESOLUTION
@BretFisher
BretFisher / cert.sh
Created August 13, 2020 18:45
docker compose with traefik and certs
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
DOMAIN_NAME=$1
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
@tom-code
tom-code / h2c.go
Last active July 7, 2023 09:33
golang h2c http2 client and server
package main
import (
"fmt"
"net/http"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"crypto/tls"
"net"
)
@anvk
anvk / psql_useful_stat_queries.sql
Last active June 14, 2024 12:50
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@mattrasband
mattrasband / chromecastdownloader.py
Created June 6, 2017 03:33
Download chromecast background
#!/usr/bin/env python3
import collections
import concurrent.futures
import json
import os
import pathlib
import re
import requests
@djrobstep
djrobstep / sqlalchemy_dynamic_table_creation.py
Created May 18, 2016 14:28
SQLAlchemy ORM code to create SQL tables from a dynamically defined column list
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from sqlalchemy import Column, MetaData, Table, create_engine
from sqlalchemy import String, Integer, Float, BigInteger, DateTime
from sqlalchemy.schema import DropTable, CreateTable
from sqlalchemy.orm import scoped_session, sessionmaker
@ismasan
ismasan / sse.go
Last active March 19, 2024 18:13
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()
@BradEstey
BradEstey / gulpfile.js
Last active December 21, 2018 05:49
Use Gulp to automatically run PHPUnit tests.
var gulp = require('gulp'),
sys = require('sys'),
exec = require('child_process').exec;
gulp.task('phpunit', function() {
exec('phpunit', function(error, stdout) {
sys.puts(stdout);
});
});
@alairock
alairock / funky-fresh.js
Last active February 3, 2017 19:24
Custom parallax effect
/**
* Main JS file for Casper behaviours
*/
$(document).ready(function(){
var lastScrollTop = 0;
$(window).scroll(function(event){
var st = $(this).scrollTop();
var scrolli = st/1.5;
scrollicious = $(".cover-image > img").css({"top": scrolli + "px"});
if (st > lastScrollTop){