Skip to content

Instantly share code, notes, and snippets.

View c0bra's full-sized avatar

Brian Hann c0bra

View GitHub Profile
/* js */
var app = angular.module('plunker', ['ngSanitize']);
app.controller('MainCtrl', function($scope, $sce) {
$scope.data = {};
$scope.val = $sce.trustAsHtml('🏠');
});
ADMIN="your-email@you.com"
# set alert level 90% is default
ALERT=90
df -H | grep -vE '^Filesystem|tmpfs|cdrom|^//|/mnt' | awk '{ print $5 " " $1 }' | while read output;
do
#echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge $ALERT ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" |
const cluster = require('cluster');
const Benchmark = require('benchmark');
const chance = require('chance').Chance();
const smeans = require('../src/smeans');
let suite = new Benchmark.Suite();
// Generate dataset
let data;
if (cluster.isMaster) {
Dim list As List(Of EXM_Spirometry)()
list.ForEach(Sub(x)
' Do whatever you want in this block.
End Sub)
@c0bra
c0bra / pre-commit
Created June 21, 2017 22:11
pre-commit hook to update and stage some files
#!/bin/sh
# Stash unstaged changes
git stash -q --keep-index
npm run build
npm run toc
# Stage changes
git add -u

Keybase proof

I hereby claim:

  • I am c0bra on github.
  • I am bhannman (https://keybase.io/bhannman) on keybase.
  • I have a public key ASAtthfP7ozPs_MEAMmOAVNNJZPQd_GaDhcOpqIE0KcAcQo

To claim this, I am signing this object:

@c0bra
c0bra / foo.html
Last active April 26, 2018 15:13
<html>
<body>
<button id="btn">Test</button>
<script>
var btn = document.getElementById('btn');
btn.addEventListener('click', function() {
// "width=800,height=600,toolbar=1,resizable=1,left=-220,top=-4"
window.open('https://google.com', 'TableauAuth', "width=800,height=600,toolbar=1,resizable=1,left=-220,top=-4");
});
</script>
@c0bra
c0bra / compile.js
Last active November 18, 2019 17:05
Testing Svelte with Jest
const rollup = require('rollup');
const esm = require('esm');
const { config } = esm(module)('../rollup.config');
function generateOptions(filePath, name) {
return {
input: { input: filePath, plugins: config.plugins },
output: {
file: `./dist/test/${name}.js`,
---------------------------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------------------------|----------|----------|----------|----------|-------------------|
All files | 7.57 | 2.83 | 5.02 | 7.38 | |
node_modules/is-dom | 50 | 0 | 0 | 50 | |
index.js | 50 | 0 | 0 | 50 | 4 |
node_modules/popper.js/dist/esm | 4.9 | 2.51 | 3.64 | 4.65 | |
popper.js | 4.9 | 2.51 | 3.64 | 4.65 |... 2467,2472,2477 |
node_modules/svelte | 2.67 | 0 | 1.85 | 2.37 | |
shared.js | 3.67 | 0 | 2.5 | 3
import * as pulumi from '@pulumi/pulumi';
import * as cloud from '@pulumi/cloud';
import * as aws from '@pulumi/aws';
import * as awsx from '@pulumi/awsx';
const config = new pulumi.Config('seniorvu');
const dbPassword = config.require('zabbixDbPassword');
let vpc = awsx.ec2.Vpc.getDefault();