Skip to content

Instantly share code, notes, and snippets.

Avatar
👍
Working remote

Tyler Sommer tyler-sommer

👍
Working remote
View GitHub Profile
View container.c
#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 Aug 16, 2019
"Arc Blue" theme for Gitea (mod of Arc Green)
View theme-arc-green.css
.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 Nov 16, 2017
Fetches an entity's zkill history and displays number of kills/losses by hour in JSON format.
View kills.sh
#!/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."
}
View keybase.md

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 Feb 15, 2017
Example go-stickgen working with squircy2
View dashboard.html.twig
{% 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">
View multi-node-hdfs-yarn
{
"host_groups": [
{
"name": "master",
"components": [
{
"name": "NAMENODE"
},
{
"name": "DATANODE"
@tyler-sommer
tyler-sommer / fix.rb
Created Oct 17, 2014
Fix broken gitlab hooks in your project repositories
View fix.rb
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 Sep 9, 2015
Adding closures to compiled symfony 2 containers
View SerializableCallable.php
<?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 Apr 5, 2020
Benchmark between SplFixedArray and regular PHP arrays with 10,000 very small elements.
View Benchmark.php
<?php
/**
* A Simple Operation Benchmark Class
*
* @author Tyler Sommer
* @license WTFPL
*/
class Benchmark {
protected $_length;
@tyler-sommer
tyler-sommer / _area_subnav.html.twig
Created Mar 21, 2013
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
View _area_subnav.html.twig
{% 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' }
] },