Skip to content

Instantly share code, notes, and snippets.

View zackproser's full-sized avatar
💭
Studying 📖

Zack Proser zackproser

💭
Studying 📖
View GitHub Profile
<template>
<div class="col-lg-4">
<div class="card card-list--hover shadow border-0">
<div class="card-body py-5">
<img
:src="`/${post.attributes.image}`"
class="img-fluid shadow mb-5"
/>
<nuxt-link :to="`/software/${post.slug}`">
<h6 :class="`text-${ct} display-4 text-uppercase`">
import Vue from 'vue'
Vue.mixin({
methods: {
getClassType () {
let c = [
'default',
'primary',
'info',
'success',
<template>
<section :class="`section pb-0 bg-gradient-${this.getClassType()}`">
<div class="container">
<div class="row row-grid" v-for="i in Math.ceil(posts.length / 3)" :key="i">
<post-card v-for="post in posts.slice((i - 1) * 3, i * 3)" v-bind:key="post.slug" :prefix="prefix" :post="post" :ct="getClassType()"></post-card>
</div>
</div>
</section>
</template>
{
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {
config.module.rules.push({
test: /\.md$/,
include: [path.resolve(__dirname, 'posts'), path.resolve(__dirname, 'blog')],
loader: 'frontmatter-markdown-loader'
<template>
<div>
<exhibit prefix="software" :slug="slug" :posts="posts" />
</div>
</template>
<script>
import Exhibit from '~/components/Exhibit.vue'
export default {
// Run commences the attack processing subroutine
func (a *AttackManager) Run() {
log.WithFields(logrus.Fields{
"Messaging Interval in Seconds": Config.Twilio.MsgIntervalSeconds,
}).Debug(AppName + " now processing attacks")
go func() {
for {
time.Sleep(time.Duration(Config.Twilio.MsgIntervalSeconds) * time.Second)
func basicAuth(h httprouter.Handle) httprouter.Handle {
return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
// Get the Basic Authentication credentials
user, password, hasAuth := r.BasicAuth()
if hasAuth && user == Config.Server.CatfactsUser && password == Config.Server.CatfactsPassword {
h(w, r, ps)
} else {
// Request Basic Authentication
w.Header().Set("WWW-Authenticate", "Basic realm=Restricted")
apiVersion: apps/v1
kind: Deployment
metadata:
name: catfacts-deployment
labels:
app: catfacts
spec:
replicas: 1
selector:
matchLabels:
FROM ubuntu
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
language-pack-en \
ca-certificates \
curl \
lsb-release \
&& apt-get purge -y \
func handleAdminSMSRequest(sender, body string, w http.ResponseWriter) {
// Attempt to parse a target number from the body of the message
valid, formatted := validateNumber(body)
if valid {
// If the number is already being attacked, stop it
if isUnderAttack(formatted) {
success, attack := stopAttack(formatted)
if success {