Skip to content

Instantly share code, notes, and snippets.

@jreyes33
jreyes33 / cowquotes.sh
Last active Nov 17, 2017
cowquotes.sh
View 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 Apr 22, 2019
Install Postman with Ansible on Linux
View postman-playbook.yml
#
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
View example1.java
public static String foo(boolean b) {
if ( b ) {
performVitallyImportantBusinessFunction();
return "OK";
}
return "FAIL";
}
@Test
View keybase.md

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 Mar 24, 2015
Better emoji support in ES6
View emoji.js
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 Aug 25, 2016
Live templates. Copy them in ~/Library/Preferences/IntelliJIdea14/templates for Ultimate or ~/Library/Preferences/IdeaIC14/templates for Community. In Linux: ~/.IdeaIC2016.2/config/templates
View custom.xml
<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" />
View app.js
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');