Skip to content

Instantly share code, notes, and snippets.

@jreyes33
jreyes33 / cowquotes.sh
Last active November 17, 2017 16:09
cowquotes.sh
#!/usr/bin/env bash
set -euo pipefail
while true
do
clear
curl -s https://talaikis.com/api/quotes/random/ |
jq -r '"“\(.quote)” —\(.author)"' |
cowsay -f $( ls /usr/share/cowsay/cows/ | shuf -n 1)
@jreyes33
jreyes33 / postman-playbook.yml
Last active April 22, 2019 17:55
Install Postman with Ansible on Linux
# …
tasks:
- name: Inspect postman file
stat: path=~/bin/Postman/Postman
register: postman_file
- name: Install postman
when: not postman_file.stat.exists
unarchive:
remote_src: yes
public static String foo(boolean b) {
if ( b ) {
performVitallyImportantBusinessFunction();
return "OK";
}
return "FAIL";
}
@Test

Keybase proof

I hereby claim:

  • I am jreyes33 on github.
  • I am jreyes (https://keybase.io/jreyes) on keybase.
  • I have a public key whose fingerprint is 96F5 0A28 0F5C 6324 D8EE DDF4 C8AD FE9F 141C 1EBE

To claim this, I am signing this object:

@jreyes33
jreyes33 / emoji.js
Created March 24, 2015 04:36
Better emoji support in ES6
let isAnimal = (emojo) =>
'🐀'.codePointAt(0) <= emojo.codePointAt(0) &&
emojo.codePointAt(0) <= '🐼'.codePointAt(0);
let emoji = ['🐶', '👻', '🐸', '🐻', '💩', '🐳'];
let animals = [for (e of emoji) if (isAnimal(e)) e];
console.log(animals);
// => ["🐶","🐸","🐻","🐳"]
@jreyes33
jreyes33 / custom.xml
Last active August 25, 2016 20:18
Live templates. Copy them in ~/Library/Preferences/IntelliJIdea14/templates for Ultimate or ~/Library/Preferences/IdeaIC14/templates for Community. In Linux: ~/.IdeaIC2016.2/config/templates
<templateSet group="custom">
<template name="ati" value="org.hamcrest.MatcherAssert.assertThat($ACTUAL$, org.hamcrest.CoreMatchers.is($EXPECTED$));" description="assertThat is" toReformat="true" toShortenFQNames="true" useStaticImport="true">
<variable name="ACTUAL" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="EXPECTED" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="true" />
<option name="JAVA_EXPRESSION" value="true" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
var express = require('express');
var fs = require('fs');
var app = express();
app.get('*', function(req, res) {
fs.readFile('public' + req.originalUrl, function(err, data) {
if (err) {
res.send('File not found ' + req.originalUrl);
} else {
res.contentType('application/json');