Skip to content

Instantly share code, notes, and snippets.

View TinyExplosions's full-sized avatar

Al Graham TinyExplosions

View GitHub Profile
console.log(
Array.apply(0, Array(20)).map(function (x, y) {
let fizz = { 0: "Fizz" }[y % 3] || "";
let buzz = { 0: "Buzz" }[y % 5] || "";
return fizz + buzz || y.toString();
}).join("\n")
);
[
{
"character": "Ethel Rainicorn",
"quote": "Jake, is that you? Are you going to let us in?",
"linkTitle": "Her Parents",
"href": "/wiki/Her_Parents"
},
{
"character": "Ethel Rainicorn",
"quote": "Ohh, he's so handsome! Oh, Bob, our daughter's finally found a handsome Rainicorn to love!",
@TinyExplosions
TinyExplosions / machineconfig.sh
Last active May 28, 2020 13:59
This is taken directly from Jorgen Dahle Naess' work to open the machine config daemon log for a certain host,
#!/bin/bash
mcdlog(){
host=$1
ns=openshift-machine-config-operator
podname=$(oc get pods -o wide --no-headers -n ${ns}| grep ${host} | egrep ^machine-config-daemon | awk '{ print $1 }')
oc logs -f ${podname} -c machine-config-daemon -n ${ns}
}
mcslog(){
var express = require('express');
var bodyParser = require('body-parser');
var cors = require('cors');
function helloRoute() {
var hello = new express.Router();
hello.use(cors());
hello.use(bodyParser.urlencoded({
extended: true
}));
require("appdynamics").profile({
controllerHostName: '<CONTROLLER URI>',
controllerPort: 443,
controllerSslEnabled: true,
accountName: '<ACCOUNT>',
accountAccessKey: '<KEY>',
applicationName: '<APP NAME>',
tierName: '<TIER NAME>',
nodeName: '<NODE NAME>'
});
require("appdynamics").profile({
controllerHostName: '<CONTROLLER URI>',
controllerPort: 443,
controllerSslEnabled: true,
accountName: '<ACCOUNT>',
accountAccessKey: '<KEY>',
applicationName: '<APP NAME>',
tierName: '<TIER NAME>',
nodeName: '<NODE NAME>'
});
@TinyExplosions
TinyExplosions / AssemblaCrawl.js
Last active January 7, 2016 11:10
Some Assembla crawling stuff
var fs = require('fs'),
request = require('request'),
spaces = [],
AssemblaApiSecret = "<API Secret>",
AssemblaApiKey = "<API Key>";
var options = {
url: 'https://api.assembla.com/v1/spaces/',
headers: {
"X-Api-Secret": AssemblaApiSecret,
@TinyExplosions
TinyExplosions / .slate
Created July 31, 2013 07:30
Slate Config
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
# Monitor Aliases
alias mon-laptop 1440x900
navigator.camera.getPicture(function(imageURI) {
new AnnotationView({img:imageURI});
this.cancelView();
}.bind(this), function(err) {
console.log("Error",err);
this.cancelView();
}.bind(this), {
sourceType: newPhoto ? Camera.PictureSourceType.CAMERA : Camera.PictureSourceType.PHOTOLIBRARY,
quality: 75,
saveToPhotoAlbum: newPhoto,
define([
'underscore',
'backbone',
'text!templates/AnnotationTemplate.html',
'hammer',
'utils'
], function(_, Backbone, AnnotationTemplate, Hammer, Utils) {
var AnnotationView = Backbone.View.extend({