Skip to content

Instantly share code, notes, and snippets.

View tyler-sommer's full-sized avatar
🖖
Working remote

Tyler Sommer tyler-sommer

🖖
Working remote
View GitHub Profile
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@tyler-sommer
tyler-sommer / theme-arc-green.css
Created August 16, 2019 14:52
"Arc Blue" theme for Gitea (mod of Arc Green)
.hljs{display:block;overflow-x:auto;padding:.5em;color:#bababa}
.repository.file.list .non-diff-file-content .code-view .lines-code ol,.repository.file.list .non-diff-file-content .code-view .lines-num{background-color:#2b2b2b!important}
.hljs-emphasis,.hljs-strong{color:#a8a8a2}
.hljs-bullet,.hljs-link,.hljs-literal,.hljs-number,.hljs-quote,.hljs-regexp{color:#6896ba}
.hljs-code,.hljs-selector-class{color:#a6e22e}
.hljs-emphasis{font-style:italic}
.hljs-attribute,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-variable{color:#cb7832}
.hljs-params{color:#b9b9b9}
.hljs-string{color:#6a8759}
.hljs-addition,.hljs-built_in,.hljs-builtin-name,.hljs-selector-attr,.hljs-selector-id,.hljs-selector-pseudo,.hljs-subst,.hljs-symbol,.hljs-template-tag,.hljs-template-variable,.hljs-type{color:#e0c46c}
@tyler-sommer
tyler-sommer / kills.sh
Created November 16, 2017 06:57
Fetches an entity's zkill history and displays number of kills/losses by hour in JSON format.
#!/bin/bash
entity_kind=""
entity_id=""
usage() {
echo "Usage: $0 [-h] [-a <allianceID> | -c <corporationID> | -p <characterID>]"
echo
echo "One option (-a, -c, -p) must be selected."
}

Keybase proof

I hereby claim:

  • I am tyler-sommer on github.
  • I am veonik (https://keybase.io/veonik) on keybase.
  • I have a public key ASDyv6_Y54xyAAFhCsGVJE3g0wzUWQSj21v5oNioNDp81Qo

To claim this, I am signing this object:

@tyler-sommer
tyler-sommer / dashboard.html.twig
Created February 15, 2017 03:27
Example go-stickgen working with squircy2
{% extends 'layout.html.twig' %}
{% block content %}
<div class="row">
<div class="col-md-8">
<h4>Dashboard</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
{
"host_groups": [
{
"name": "master",
"components": [
{
"name": "NAMENODE"
},
{
"name": "DATANODE"
@tyler-sommer
tyler-sommer / fix.rb
Created October 17, 2014 17:52
Fix broken gitlab hooks in your project repositories
Dir.glob('/home/git/repositories/**/*.git') do |item|
hook = "#{item}/hooks"
if not File.symlink?(hook)
puts "Updating #{hook}"
File.rename(hook, "#{hook}.old")
File.symlink("/home/git/gitlab-shell/hooks", hook)
end
end
@tyler-sommer
tyler-sommer / SerializableCallable.php
Last active September 9, 2015 04:26
Adding closures to compiled symfony 2 containers
<?php
/**
* Serializable Closure
*
* Allows the serialization of a closure, specifically a Closure, for storage
*/
class SerializableCallable implements \Serializable
{
/**
@tyler-sommer
tyler-sommer / Benchmark.php
Last active April 5, 2020 18:51
Benchmark between SplFixedArray and regular PHP arrays with 10,000 very small elements.
<?php
/**
* A Simple Operation Benchmark Class
*
* @author Tyler Sommer
* @license WTFPL
*/
class Benchmark {
protected $_length;
@tyler-sommer
tyler-sommer / _area_subnav.html.twig
Created March 21, 2013 23:05
This abuse of the twig templating engine can be used to generate menus given a fairly nice declaration syntax. Currently, it will generate a semi customized bootstrap menu
{% block subnav %}
{# This is how you declare a menu #}
{% include '::subnav.html.twig' with { pages: [
{ name: 'Manage', dropdown: [
{ route: 'customers', name: 'Customers' },
{ route: 'orders', name: 'Orders' },
{ route: 'chargebacks', name:'Chargebacks', role: 'ROLE_ADMIN' }
] },