Skip to content

Instantly share code, notes, and snippets.

Avatar

Al Graham TinyExplosions

View GitHub Profile
View fizzy.js
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")
);
View adventure-time-quotes.json
[
{
"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
This is taken directly from Jorgen Dahle Naess' work to open the machine config daemon log for a certain host,
View machineconfig.sh
#!/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(){
View hello.js
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
}));
View not working.js
require("appdynamics").profile({
controllerHostName: '<CONTROLLER URI>',
controllerPort: 443,
controllerSslEnabled: true,
accountName: '<ACCOUNT>',
accountAccessKey: '<KEY>',
applicationName: '<APP NAME>',
tierName: '<TIER NAME>',
nodeName: '<NODE NAME>'
});
View working.js
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 Jan 7, 2016
Some Assembla crawling stuff
View AssemblaCrawl.js
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,
View .slate
# 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
View Annotate.js
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,
View AnnotationView.js
define([
'underscore',
'backbone',
'text!templates/AnnotationTemplate.html',
'hammer',
'utils'
], function(_, Backbone, AnnotationTemplate, Hammer, Utils) {
var AnnotationView = Backbone.View.extend({