Skip to content

Instantly share code, notes, and snippets.

import React from 'react';
import ReactMarkdown from 'react-markdown';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import Link from '@material-ui/core/Link';
import Table from "@material-ui/core/Table";
import TableContainer from "@material-ui/core/TableContainer";
import Paper from "@material-ui/core/Paper";
import {TableHead, TableRow, TableCell, TableBody} from "@material-ui/core";
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@rhenning
rhenning / equifax2017.md
Created September 14, 2017 12:29
Equifax 2017 Security Compromise Notes

Equifax Credit Reporting Agency Compromise of 2017

Overview

Credit histories of 143 million Americans were stolen from Equifax by hackers in May 2017 due to compromise of an unpatched Apache Struts software vulnerability (CVE-2017-5638). Equifax disclosed the breach in early September 2017.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@lusis
lusis / README.md
Last active September 14, 2020 17:47
terraform template to generate serverspec properties

This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.

  • create the Rakefile in your terraform project root
  • create a spec directory and put spec_helper.rb in it
  • create the templates/properties.tmpl.yml file
  • create the serverspec.tf
  • terraform apply

tests

Tests will be matched based on roles defined for a given node.

@LuoZijun
LuoZijun / IP2Hex.py
Last active August 18, 2022 10:51
IPv4 Address to a 32-bit integer value
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
IPv4 addresses to a 32-bit integer value
Document: https://en.wikipedia.org/wiki/IPv4#Address_representations
IPv4 addresses may be in any notation expressing a 32-bit integer value,
@addyosmani
addyosmani / unit_testing.md
Last active July 27, 2020 05:17
Unit Testing Polymer Elements

Deprecated. See https://www.polymer-project.org/articles/unit-testing-elements.html for the latest version.

Unit Testing Polymer Elements

Note: this guide is a work-in-progress and will be added to the Polymer docs when it's ready. We have updated <seed-element> to include unit tests and this guide has been moved to Google docs. Expect a version on the Polymer site before the end of September.

After spending days working on your <super-awesome> Polymer element, you’re finally ready to share it with the rest of the world. You add the code for using it to your demo, iterate on it over time and come back to it one day when..uh oh. The demo broke because something has gone horribly wrong. Suddenly, <super-awesome> isn’t starting to look so great. Now you’re stuck trying to backtrack through your commit log to figure out how you broke the code. You’re not going to have a fun time.

If you’ve been working on the front-end for a while, even if you haven’t really played with Polymer elements before, this s

values = ["a", "b", "c"]
result = (1..values.length).inject([]) { |buffer, count|
buffer |= values.combination(count).to_a
}.map(&:join)
result # => ["a", "b", "c", "ab", "ac", "bc", "abc"]
@karlseguin
karlseguin / fakeresponse.go
Created March 10, 2013 12:51
A fake http.ResponseWriter class, used for testing. See http://openmymind.net/Testing-In-Go/
package fakeresponse
import (
"testing"
"net/http"
)
type FakeResponse struct {
t *testing.T
headers http.Header
@phred
phred / pedantically_commented_playbook.yml
Last active November 3, 2023 01:55
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####