Skip to content

Instantly share code, notes, and snippets.

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

Marcelo Andrade marceloandrader

🏠
Working from home
View GitHub Profile
@marceloandrader
marceloandrader / callbacks.js
Last active May 14, 2024 02:29
Functions are objects
// you can create a function by passing the
// Function constructor a string of code
var func_multiply = new Function("arg1", "arg2", "return arg1 * arg2;");
func_multiply(5,10); // => 50
CREATE TABLE `account_preferences` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`account_id` INT(10) UNSIGNED NOT NULL,
`first_name` VARCHAR(45) NULL,
`last_name` VARCHAR(45) NULL,
`details` TEXT NOT NULL,
`created_dt` DATETIME NULL,
`updated_dt` DATETIME NULL,
PRIMARY KEY (`id`),
INDEX `fk_account_preferences_1_idx` (`account_id` ASC),
#!/usr/bin/php
<?php
# create a filename for the emlx file
list($ms, $time) = explode(' ', microtime());
$filename = dirname(__FILE__).'/'.date('Y-m-d h.i.s,', $time).substr($ms,2,3).'.emlx';
# write the email contents to the file
$email_contents = fopen('php://stdin', 'r');
$fstat = fstat($email_contents);
@marceloandrader
marceloandrader / docker-inspect
Created March 26, 2014 15:30
docker inspect
[{
"id": "05d3b2342a085d924bdf2fb72578d56e8ba43f1a7ea9bbafdd4b22923c58a4eb",
"parent": "7e32972eaaefab0f5d617a22b4896352bb2e61cf4ef425be2f502a688110232c",
"created": "2013-06-09T07:11:43.251159959Z",
"container": "75f01691656358e72608c63ef0ae13f7e2c1f5451701dc2a8e6307f12cc99ef4",
"container_config": {
"Hostname": "4781390780b2",
"Domainname": "",
"User": "",
"Memory": 0,
- If patient Admit Length of Stay > Care Plan (Pre-Op Eval) Length of Stay then add to At Risk count, end
- else If today > (actual admit date from admit survey + expected length of stay from the care plan (Pre-op Eval)) then add to At Risk count, end
composer install
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- digintent/mefworks 1.0.1 requires php >=5.5.0 -> no matching package found.
- digintent/mefworks 1.0.0 requires php >=5.5.0 -> no matching package found.
- Installation request for digintent/mefworks 1.* -> satisfiable by digintent/mefworks[1.0.0, 1.0.1].
{
"name": "digintent/ppmd-coordinated-care",
"description": "PPMD-IBJI",
"authors": [
{
"name": "Digintent Team",
"email": "[email protected]"
}
],
"repositories": [
from MySQLdb import connect
conn = connect(user="root", passwd="", host="localhost")
cur = conn.cursor()
cur.execute("show databases;")
dbs_to_update = filter(
lambda db: db in ('ppmd_coordinated'),
[dbname[0] for dbname in cur.fetchall()])
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
DIR="$( dirname "$SOURCE" )"
cd $DIR/../www/
php index.php --task=migrator --action=$1
<?php
class DI_Field_Template extends DI_Field implements ArrayAccess
{
protected $template;
protected $fields = [];
protected $defaultTemplate = 'template';
protected $uuid = '_tpl_';
public function __construct(DI_Field $template, $uuid = '_tpl_')
{