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
from keras.callbacks import Callback | |
class PatientTrainingCallback(Callback): | |
def __init__(self): | |
Callback.__init__(self) | |
self.episode_finished = True | |
self.end_train_before_episode_end = False | |
def on_train_begin(self, logs=None): | |
pass |
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 io | |
import json | |
from socket import socket, AF_INET, SOCK_STREAM | |
class SocketIO(io.RawIOBase): | |
def __init__(self, sock): | |
self.sock = sock | |
def read(self, sz=-1): | |
if (sz == -1): sz=0x7FFFFFFF | |
return self.sock.recv(sz) |
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
<? | |
// Insert this before throw in getNamespace() | |
foreach ((array) data_get($composer, 'autoload-dev.psr-4') as $namespace => $path) { | |
foreach ((array) $path as $pathChoice) { | |
if (realpath(app_path()) == realpath(base_path().'/../'.$pathChoice)) { | |
return $this->namespace = $namespace; | |
} | |
} | |
} |
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
package even_or_odd | |
import ( | |
"testing" | |
"math" | |
) | |
type Solution func (int) string | |
var smartMap = map[int]string{0: "Even", 1: "Odd"} |
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
'.source.js.jsx': | |
'Component': | |
'prefix': 'rcom' | |
'body': ''' | |
import React, { Component } from 'react' | |
import PropTypes from 'prop-types' | |
${1:import ${2:...} from '${3:package}' | |
}class ${4:MyComponent} extends Component { |
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
'atom-text-editor.vim-mode-plus:not(.insert-mode)': | |
'ctrl-d': 'find-and-replace:select-next' |
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
# ... | |
# | |
# Mounting Blackberry device | |
//<host>/media <mountpoint> cifs credentials=/home/<user>/.smbcred,user,gid=<user>,uid=<user_group>,file_mode=0640,dir_mode=0750 0 0 |
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
# Encountered an error when tested console output: | |
# | |
# ActiveModelSerializers::Adapter::JsonApi::PaginationLinks::MissingSerializationContextError: JsonApi::PaginationLinks requires a ActiveModelSerializers::SerializationContext. | |
# Please pass a ':serialization_context' option or | |
# override CollectionSerializer#paginated? to return 'false'. | |
# Usual RSpec matcher definition | |
RSpec::Matchers.define :render_serialized_json_data do |expected| | |
match do |actual| | |
# Prepairing serialized JSON from ActiveRecord(s) |