Skip to content

Instantly share code, notes, and snippets.

View kmikzjh's full-sized avatar
🏠
Working from home

Jonathan Hernandez kmikzjh

🏠
Working from home
View GitHub Profile
@kmikzjh
kmikzjh / dynamodb-json-mapper.js
Created March 3, 2020 14:08 — forked from igorzg/dynamodb-json-mapper.js
Dynamo db json re mapper
/**
* Dynamodb types
S String
N Number
B Binary
BOOL Boolean
NULL Null
M Map
L List
@kmikzjh
kmikzjh / print_progress.py
Created May 24, 2018 15:15 — forked from aubricus/License
Python Progress Bar
# -*- coding: utf-8 -*-
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
@kmikzjh
kmikzjh / DateTimeDecoder.py
Created February 23, 2018 21:06 — forked from abhinav-upadhyay/DateTimeDecoder.py
A JSON decoder/encoder implementation for parsing dates as datetime objects in Python
#!/usr/bin/env python
# An example of decoding/encoding datetime values in JSON data in Python.
# Code adapted from: http://broadcast.oreilly.com/2009/05/pymotw-json.html
from datetime import datetime
import json
from json import JSONDecoder
from json import JSONEncoder
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
"use strict"
mongoose = require "mongoose"
Order = mongoose.model "Order"
config = require "../../config/config"
fs = require "fs"
sh = require "execSync"
exports.close = (req, res) ->
Order.findById req.body.TBK_ORDEN_COMPRA, (err, order) ->
@kmikzjh
kmikzjh / laravel model test.skema
Created October 14, 2014 16:38
laravel database designer test
[{"name":"Bears","color":"Blue","position":{"x":177,"y":85},"modelclass":"Bear","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c217","name":"id","type":"increments","length":"0","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c218","name":"name","type":"string","length":"200","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c219","name":"danger_level","type":"string","length":"200","order":2,"defaultvalue":"","enumvalue":""}],"relation":[{"extramethods":"","foreignkeys":"","name":"fish","relatedmodel":"Fish","relationtype":"hasOne","usenamespace":""},{"extramethods":"","foreignkeys":"","name":"trees","relatedmodel":"Trees","relationtype":"hasMany","usenamespace":""},{"extramethods":"","foreignkeys":"bear_id, picnic_id","name":"picnics","relatedmodel":"Picnics","relationtype":"belongsToMany","usenamespace":""}],"seeding":[]},{"name":"Fish","color":"Yellow","position":{"x":1063,"y":14},"modelclass":"Fish","increment":false,"timestamp":false,"softdelete":false,"column":[{"c
@auth.requires_membership(role='Super Administrador')
def admin():
return {'menu':UL([A(t, _href=URL(args=t)) for t in db.tables]),
'admin':SQLFORM.smartgrid(db[request.args(0) or 'auth_user'])}
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
<?php
class Parenthesis extends TerminalExpression {
protected $precidence = 6;
public function operate(Stack $stack) {
}
public function getPrecidence() {
return $this->precidence;
<?php
header('HTTP/1.1 403 Forbidden');
?>
<html>
<head>
<title>Congratulations! You have been DENIED access</title>
</head>
<body>
<font size="4">You have been denied access because of the following reasons:<br /><br />
1.) Too many failed login attempts, so you are likely brute forcing through logins.<br />