This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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`"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
Vue.mixin({ | |
methods: { | |
getClassType () { | |
let c = [ | |
'default', | |
'primary', | |
'info', | |
'success', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<exhibit prefix="software" :slug="slug" :posts="posts" /> | |
</div> | |
</template> | |
<script> | |
import Exhibit from '~/components/Exhibit.vue' | |
export default { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: catfacts-deployment | |
labels: | |
app: catfacts | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |