Skip to content

Instantly share code, notes, and snippets.

View ibolmo's full-sized avatar
🧠

Olmo Maldonado ibolmo

🧠
View GitHub Profile
@ibolmo
ibolmo / jsonapi_oas.yml
Created July 6, 2020 20:13 — forked from naesean/jsonapi_oas.yml
OpenAPI 3.0 schemas that comply with the JSON:API 1.0 specification
JSONAPIObject:
description: Includes the current JSON:API version for this specification as well as optional meta information
type: object
required:
- version
properties:
version:
type: string
default: '1.0'
example: '1.0'
@ibolmo
ibolmo / dshell
Last active September 12, 2017 18:14 — forked from bcooksey/dshell
dshell: A little wrapper around the docker-compose run command that intelligently gets you a shell inside a container
#!/bin/bash
CONTAINER_ID=`docker ps -f status=running -f name=web_run -n 1 | head -n 2 | tail -n 1 | cut -d' ' -f1`
if [[ "${CONTAINER_ID:0:9}" = "CONTAINER" ]]; then
echo "No container exists, creating it (hit enter after a sec to bring up terminal)..."
docker-compose run --service-ports web /bin/bash
exit 0
fi
@ibolmo
ibolmo / dummy-web-server.py
Last active August 29, 2015 14:26 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@ibolmo
ibolmo / Code.gs
Last active June 7, 2016 07:46 — forked from bmcbride/Code.gs
// Create or open an existing Sheet and click Tools > Script editor and enter the code below
// 1. Enter sheet name where data is to be written below
var SHEET_NAME = "Sheet1";
// 2. Run > setup
// 3. Publish > Deploy as web app
// - enter Project Version name and click 'Save New Version'
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
// 4. Copy the 'Current web app URL' and post this in your form/script action
// 5. Insert column names on your destination sheet matching the parameter names of the data you are passing in (exactly matching case)
(function(){
var re, units = {ms: 1, s: 1e3};
Duration = function(value){
return Duration.parse(value);
};
Duration.parse = function(value){
var match = value.toString().match(re);
@ibolmo
ibolmo / Element.js
Created August 12, 2011 18:07 — forked from arian/Element.js
select.get('value');
/*<ltIE9>*/
var testForm = document.createElement('form');
testForm.innerHTML = '<select><option>s</option></select>';\
if (testForm.firstChild.value != 's') Element.Properties.value = {
get: function(){
var option = this, tag = option.get('tag');
if (tag != 'select' && tag != 'option') return this.getProperty('value');
@ibolmo
ibolmo / Element.js
Created August 12, 2011 17:31 — forked from arian/Element.js
select.get('value');
/*<ltIE9>*/
var testForm = document.createElement('form');
testForm.innerHTML = '<select><option>s</option></select>';
if (testForm.firstChild.value != 's') Element.Properties.value = {get: function(){
if (this.get('tag') != 'select') return this.getProperty('value');
var selected = this.getSelected()[0];
if (!selected) return '';
@ibolmo
ibolmo / Element.js
Created August 12, 2011 17:31 — forked from arian/Element.js
select.get('value');
/*<ltIE9>*/
var testForm = document.createElement('form');
testForm.innerHTML = '<select><option>s</option></select>';
if (testForm.firstChild.value != 's'){
Element.Properties.value = {
get: function(){
if (this.get('tag') == 'select'){
var selected = this.getSelected()[0];
if (!selected) return '';
@ibolmo
ibolmo / Core-with-provides.js
Created June 4, 2011 14:40 — forked from arian/moo.js
MooTools.provide|require .. Vaporware. This is a DDD process. Imagine what interface you'd like to work with, and actually try to get it to work for the developer. Then we can make the underlying code.
// the function gives the mootools context. this refers to a shared space that is not window.
// one could apply the context to window, so that native types are augmented, but by default it's best to work within the anon. function
MooTools.provide('typeOf', function(){
this.typeOf = function(item){
if (item == null) return 'null';
if (item.$family) return item.$family();
if (item.nodeName){
var Foo = 'bar';