Skip to content

Instantly share code, notes, and snippets.

@the-gigi
the-gigi / grok_feeder.py
Last active August 29, 2015 14:08
Little program to feed data to Grok on AWS
from argparse import ArgumentParser
from collections import defaultdict
import json
import os
import socket
import urllib
import dateutil.parser
from aclima.common.datetime_util import (utc_time,
datetime_to_epoch_milliseconds,
epoch_milliseconds_to_datetime)
@the-gigi
the-gigi / ansible_setup_command_output.txt
Last active August 29, 2015 14:15
Automate your Infrastructure with Ansible - 'setup' command output
porthos | success >> {
"ansible_facts": {
"ansible_all_ipv4_addresses": [
"10.0.2.15",
"192.168.66.11"
],
"ansible_all_ipv6_addresses": [
"fe80::a00:27ff:fe88:ca6",
"fe80::a00:27ff:fe41:7b05"
],
@the-gigi
the-gigi / React.js playground
Created April 16, 2015 18:51
React.js playground
<html>
<head>
<title>Simple React.js skeleton</title>
<script src="https://fb.me/react-0.13.1.js"></script>
<script src="https://fb.me/JSXTransformer-0.13.1.js"></script>
</head>
<body>
<div id="content"></div>
<script type="text/jsx">
var green_bullet = "http://upload.wikimedia.org/wikipedia/commons/6/68/Bullet-green.png"
@the-gigi
the-gigi / go2_error_handling_feedback.md
Last active July 17, 2019 06:07
Go 2 Error Handling Feedback

Overview

I like the direction of minimizing error handling boilerplate and repetitive code. But, I think the propose soluiton is too heavy handed especially for the most common case of simply returning an error as is when a called function returns error:

func foo() int, error {
  result, err := bar()
  // If bar() returned an error just return it as is
  if err != nil {
 result , err 
console.log('Yeah, it works!!!')
import { assertEquals } from "https://deno.land/std@0.93.0/testing/asserts.ts";
assertEquals(2 + 2, 5);
console.log('success!')
import { assertEquals } from "https://deno.land/std@0.93.0/testing/asserts.ts";
assertEquals(2 + 2, 4);
console.log('success!')
const promise = Deno.run({cmd: ['deno', 'eval', 'console.log(2+3)']})
await promise.status()
/*
Output:
5
*/
Deno.writeTextFileSync('data.txt', 'some data')
function foo()
{
console.log('foo here')
const x = 3
console.log('x + 2 =', x+2)
}
foo()