This file contains 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 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 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 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
/home/travis/build.sh: line 175: ./gradlew: Permission denied | |
Fix by setting the executable flag on your gradlew file. | |
Either | |
chmod +x gradlew (on unix systems) | |
OR |
This file contains 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
-- cards are what you review. easy! | |
CREATE TABLE cards ( | |
id integer primary key, | |
-- the epoch milliseconds of when the card was created | |
nid integer not null, | |
-- notes.id | |
did integer not null, | |
-- deck id (available in col table) | |
ord integer not null, | |
-- ordinal, seems like. for when a model has multiple templates, or thereabouts |
This file contains 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 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 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 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 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); |
NewerOlder