Skip to content

Instantly share code, notes, and snippets.

View ajruckman's full-sized avatar

A.J. Ruckman ajruckman

  • Oak Ridge National Laboratory
  • Knoxville, Tennessee
View GitHub Profile
@justincase
justincase / gist:5469009
Created April 26, 2013 17:45
Print struct with field names and values. From http://blog.golang.org/2011/09/laws-of-reflection.html
type T struct {
A int
B string
}
t := T{23, "skidoo"}
s := reflect.ValueOf(&t).Elem()
typeOfT := s.Type()
for i := 0; i < s.NumField(); i++ {
@tommaitland
tommaitland / form.html
Last active January 1, 2024 09:55
A form with every HTML form element (up to HTML5) for styling.
<form action="/">
<legend>A Sample Form Legend</legend>
<label for="name">Name: </label>
<input type="text" value="Name" name="Name" />
<label for="email">Email: </label>
<input type="email" value="Email" name="Email" />
@machupicchubeta
machupicchubeta / convert_snakecase_to_camelcase_in_c#
Created April 7, 2014 07:32
convert snake case to camel case in c#
"foo_bar".Split(new [] {"_"}, StringSplitOptions.RemoveEmptyEntries).Select(s => char.ToUpperInvariant(s[0]) + s.Substring(1, s.Length - 1)).Aggregate(string.Empty, (s1, s2) => s1 + s2);
@z-------------
z------------- / material-colors.scss
Last active August 10, 2019 15:53
A big ol' list of Sass/SCSS variables containing every color in the Material Design color spec (https://www.google.com/design/spec/style/color.html). No, I did not hand copy these.
$black: #000000;
$white: #FFFFFF;
$red50: #FFEBEE;
$red100: #FFCDD2;
$red200: #EF9A9A;
$red300: #E57373;
$red400: #EF5350;
$red500: #F44336;
$red600: #E53935;
$red700: #D32F2F;
@0XDE57
0XDE57 / config.md
Last active May 30, 2024 19:04
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@jtribble
jtribble / material-design-color-palette.scss
Last active August 10, 2019 15:53
Google Material Design color palette variables for PostCSS/Sass. See: http://www.google.com/design/spec/style/color.html
/**
* Google Color Palette: http://www.google.com/design/spec/style/color.html
*/
$materialize-red-lighten-5: #fdeaeb;
$materialize-red-lighten-4: #f8c1c3;
$materialize-red-lighten-3: #f3989b;
$materialize-red-lighten-2: #ee6e73;
$materialize-red-lighten-1: #ea454b;
$materialize-red-base: #e51c23;
@karlding
karlding / bs-sans.py
Last active July 19, 2019 09:56
Parse TTX dumps and grab ligatures substitution rules found in GSUB tables (using Sans Bullshit Sans as an example)
import xml.dom.minidom
import sys
data = "".join(sys.stdin)
dom = xml.dom.minidom.parseString(data)
ligature_sets = dom.getElementsByTagName('LigatureSet')
char_map = dom.getElementsByTagName('cmap')[0].getElementsByTagName('cmap_format_4')[0].getElementsByTagName('map')
for ligature_set in ligature_sets:
# @file /etc/systemd/system/docker-postgres.service
# @see https://docs.docker.com/articles/host_integration/
[Unit]
Description=postgres container
Requires=docker.service
After=docker.service
[Service]
Restart=always
@svanoort
svanoort / gcsettings.sh
Last active December 20, 2023 02:27
Blessed GC settings for big servers
# Base settings and GC logging
-server -XX:+AlwaysPreTouch # First should be default, but we make it explicit, second pre-zeroes memory mapped pages on JVM startup -- improves runtime performance
# -Xloggc:gc-%t.log # CUSTOMIZE LOCATION HERE - $path/gc-%t.log -- the %t in the gc log file path is so we get a new file with each JVM restart
-XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m # Limits the number of files, logs to folder
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause
-XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy # gather info on object age & reference GC time for further tuning if needed.
# G1 specific settings -- probably should be default for multi-core systems with >2 GB of heap (below that, default is probably fine)
-XX:+UseG1GC
-XX:+UseStringDeduplication
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active February 10, 2024 09:16
Detect new network devices connecting to OpenWrt and send text message