This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
message ModelServerConfig { | |
ModelConfigList model_config_list = 1; | |
} | |
message ModelConfigList { | |
repeated ModelConfig config = 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
from argparse import ArgumentParser | |
argument_parser = ArgumentParser() | |
argument_parser.add_argument('root') | |
argument_parser.add_argument('file') | |
args = argument_parser.parse_args() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use Doctrine\Common\Inflector\Inflector; | |
use Doctrine\DBAL\Types\IntegerType; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\DB; | |
class CreateMissingForeignKeyMigration extends Command |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Colors { | |
private $foreground_colors = array(); | |
private $background_colors = array(); | |
public function __construct() { | |
// Set up shell colors | |
$this->foreground_colors['black'] = '0;30'; | |
$this->foreground_colors['dark_gray'] = '1;30'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Setup encrypted disk image | |
# For Ubuntu 14.04 LTS | |
CRYPTFS_ROOT=/cryptfs | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install cryptsetup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// TODO: Verify if we're getting loaded from multiples location and prevent creating new child processes? | |
var EventEmitter2 = require('eventemitter2').EventEmitter2; | |
var path = require('path'); | |
var spawn = require('child_process').spawn; | |
var events = new EventEmitter2({wildcard: true}); | |
var javaPath = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function xmlToArray($xml, $options = array()) { | |
$defaults = array( | |
'namespaceSeparator' => ':',//you may want this to be something other than a colon | |
'attributePrefix' => '@', //to distinguish between attributes and nodes with the same name | |
'alwaysArray' => array(), //array of xml tag names which should always become arrays | |
'autoArray' => true, //only create arrays for tags which appear more than once | |
'textContent' => '$', //key used for the text content of elements | |
'autoText' => true, //skip textContent key if node has no attributes or child nodes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function xml2js($xmlnode) | |
{ | |
$root = func_num_args() <= 1; | |
$jsnode = []; | |
if ($root) { | |
$nodename = $xmlnode->getName(); | |
$jsnode[$nodename] = xml2js($xmlnode, true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$packages = [ | |
// Your packages here | |
'tomzx/file-tracker: ~0.1@dev', | |
]; | |
$commands = [ | |
['require', 'packages' => $packages, '--no-update' => true], | |
['install'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
<<<CONFIG | |
packages: | |
- "your/dependencies: 1.0" | |
CONFIG; | |
if ( ! file_exists('composer.phar')) { | |
file_put_contents('composer.phar', fopen('https://getcomposer.org/composer.phar', 'r')); | |
} |
NewerOlder