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
# The following produces DetachedInstanceError | |
app = Flask(__name__) | |
db = SQLAlchemy(app) | |
class Foo(db.Model): | |
id = db.Column(db.Integer, primary_key=True) | |
foo = Foo() | |
db.session.add(foo) |
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 six | |
from mock import patch | |
from six.moves import configparser as ConfigParser | |
data = """ | |
[section] | |
key = value | |
""" |
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
type TestSetter struct { | |
cmd *redis.StatusCmd | |
} | |
func (t *TestSetter) Set(k string, v interface{}, d time.Duration) *redis.StatusCmd { | |
return t.cmd | |
} | |
// Unit - make it fail | |
func Test_setUser(t *testing.T) { |
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 main | |
import ( | |
"bufio" | |
"bytes" | |
"flag" | |
"io/ioutil" | |
"path/filepath" | |
"testing" | |
) |
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 main | |
import ( | |
"bufio" | |
"bytes" | |
"flag" | |
"io/ioutil" | |
"path/filepath" | |
"testing" | |
) |
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 main | |
import ( | |
"bufio" | |
"bytes" | |
"io/ioutil" | |
"path/filepath" | |
"testing" | |
) |
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 main | |
import ( | |
"bufio" | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io" | |
"os" | |
) |
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
Facio | |
Facio is a project scaffolding tool originally developed for Django and | |
expanded to be framework agnostic. You can use Facio to bootstrap any sort | |
of project. | |
Documentation: | |
https://facio.readthedocs.org | |
Usage: |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# | |
# Ensure you set your file system mount to NFS, you'll need to provide the VM with a static IP for a hostonly network. | |
# | |
Vagrant::Config.run do |config| | |
# ... |
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
func (p *PerceptorService) Run() { | |
for { | |
conn, _, err := d.Dial(host, headers) | |
if err != nil { | |
fmt.Printf("WS Connection Failure: %s", err) | |
time.Sleep(time.Second) | |
continue | |
} | |
ReadLoop: | |
for { |
NewerOlder