This file contains hidden or 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
'use strict'; | |
const AWS = require('aws-sdk'); | |
const cloudwatch = new AWS.CloudWatch(); | |
const endDate = new Date(); | |
const startDate = new Date(endDate.getTime() - (3600 * 24 * 1000)); // 1 day ago | |
This file contains hidden or 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
'use strict'; | |
const | |
path = require('path'), | |
webpack = require('webpack'), | |
ExtractTextPlugin = require('extract-text-webpack-plugin'), | |
HtmlWebpackPlugin = require('html-webpack-plugin'), | |
CopyWebpackPlugin = require('copy-webpack-plugin'), | |
dotenv = require('dotenv'), | |
isProduction = process.env.NODE_ENV === 'production', |
This file contains hidden or 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
#!/bin/bash | |
# First of all, you'll need ipcalc utility. | |
# ipcalc can be downloaded at jodies.de/ipcalc | |
WHOIS_QUERY = "some-netname" | |
whois -h whois.apnic.net $WHOIS_QUERY | grep inetnum | grep -Eo '[0-9].+' | sed 's/ //g' | xargs -I IP_RANGE sh -c 'ipcalc -rn IP_RANGE | tail -n +2' | |
# ###################### | |
# Explaination |
This file contains hidden or 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
#!/bin/bash | |
echo 'Checking last commit id' | |
# Change repo to monitor | |
GIT_REPO=https://github.com/torvalds/linux.git | |
LATEST_COMMIT_LOG=$(git ls-remote $GIT_REPO refs/heads/master) | |
LAST_FETCHED_COMMIT_LOG=$(cat /tmp/last-commit.log 2>/dev/null) |
This file contains hidden or 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
'use strict'; | |
const fs = require('fs'); | |
const Canvas = require('canvas'); | |
const width = 600; | |
const height = 300; | |
const canvas = new Canvas(width, height); // creates 400px * 200px size canvas | |
// draw |
This file contains hidden or 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
const { text, send } = require('micro'); | |
const request = require('request'); | |
const debug = require('debug'); | |
const LOG_TAG = 'bosun-slack-proxy'; | |
debug.enable(LOG_TAG); | |
const log = debug(LOG_TAG); | |
module.exports = async (req, res) => { | |
const requestBody = await text(req); |
This file contains hidden or 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
const Canvas = require('canvas'); | |
const fs = require('fs'); | |
const canvas = new Canvas(640, 480); // creates 6400px * 480px canvas | |
const ctx = canvas.getContext('2d'); // get 2d context | |
// Fill background | |
ctx.fillStyle = "rgb(255, 255, 255)" | |
ctx.fillRect(0, 0, canvas.width, canvas.height); |
This file contains hidden or 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
/** | |
* Created by Prescott on 2015-05-08. | |
*/ | |
const ffi = require("ffi"); | |
// const ref = require('ref'); | |
/* | |
const intPtr = ref.refType(ref.types.int32); |
This file contains hidden or 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
<img src="https://cdn.my-awesome-website.com/images/some-image.gif" alt="Some animated image"> |
This file contains hidden or 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
<!-- OLD GIF Markup --> | |
<img src="https://cdn.my-awesome-website.com/images/awesome-animation.gif" alt="My awesome animated image"> | |
<!-- NEW Video Markup --> | |
<video autoplay loop muted playsinline> | |
<!-- Specify video sources --> | |
<source src="https://cdn.my-awesome-website.com/images/awesome-and-efficient-animation.mp4" type="video/mp4"> | |
<source src="https://cdn.my-awesome-website.com/images/awesome-and-efficient-animation.webm" type="video/webm"> | |