Skip to content

Instantly share code, notes, and snippets.

View tjad's full-sized avatar

Tjad Clark tjad

  • Oivan
  • Kohn Kaen, Thailand
View GitHub Profile
module: {
rules: [
{
test: /\.styl$/,
loader: 'style-loader!css-loader!stylus-loader'
},
{ test: /\.css$/i,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader?sourceMap']
@tjad
tjad / Error
Created February 16, 2018 17:18
Neo4jrb 9.1.3, neo4j-core 8.1.0, neo4j localhost instance 3.3.3
ERROR - NoMethodError - undefined method `signature' for 46:Integer:
/usr/local/lib/ruby/gems/2.4.0/gems/neo4j-core-8.1.0/lib/neo4j/core/cypher_session/adaptors/bolt.rb:206:in `block in flush_messages'
/usr/local/lib/ruby/gems/2.4.0/gems/neo4j-core-8.1.0/lib/neo4j/core/cypher_session/adaptors/bolt.rb:206:in `block in flush_messages': undefined method `signature' for 46:Integer (NoMethodError)
from /usr/local/lib/ruby/gems/2.4.0/gems/neo4j-core-8.1.0/lib/neo4j/core/cypher_session/adaptors/bolt.rb:205:in `map'
from /usr/local/lib/ruby/gems/2.4.0/gems/neo4j-core-8.1.0/lib/neo4j/core/cypher_session/adaptors/bolt.rb:205:in `flush_messages'
from /usr/local/lib/ruby/gems/2.4.0/gems/neo4j-core-8.1.0/lib/neo4j/core/cypher_session/adaptors/bolt.rb:35:in `connect'
from /usr/local/lib/ruby/gems/2.4.0/gems/neo4j-core-8.1.0/lib/neo4j/core/cypher_session.rb:11:in `initialize'
from /usr/local/lib/ruby/gems/2.4.0/gems/neo4j-9.1.3/lib/neo4j/active_base.rb:35:in `new'
from /usr/local/lib/ruby/gems/2.4.0/gems/neo4j-9.1.
import {TestParent} from 'test-parent'
import {useView} from 'aurelia-framework'
@useView('test-parent.html')
export class ChildOne extends TestParent{
constructor(){
super()
}
}
@tjad
tjad / bs-tooltip-button.js
Created February 27, 2017 16:33
Bootstrap 3
import {inject, customAttribute} from 'aurelia-framework'
@inject(Element)
@customAttribute('bs-tooltip')
export class BsTooltip {
constructor(element){
this.element = element
}
valueChanged(newVal, oldVal) {
@tjad
tjad / example_usage.rb
Created February 9, 2017 15:46
Short hand syntax for retrieving association object graph
#to recieve the respective associations
Person.with_associations( {brothers: {:children [:daughters, :sons] }})
#Outputs all associations as an object graph structure defined above by each associations depth
class OtherModel
include ActiveNode
property :name
end
class MyModel
include ActiveNode
has_one :out, :other_model, :SOME_TYPE
end
source 'https://rubygems.org'
# Distribute your app as a gem
# gemspec
# Server requirements
# gem 'thin' # or mongrel
# gem 'trinidad', :platform => 'jruby'
# Optional JSON codec (faster performance)
@tjad
tjad / gist:1281037
Created October 12, 2011 11:57
Most common associations
Have table A, B
Have a joining table C (a_id,b_id)
SELECT DISTINCT A.*
FROM A
INNER JOIN C ON C.a_id=A.id
WHERE C.b_id = 5
The above is a simple query that will find me stuff associated with the specified b_id. I would like it to only return records if the b_id specified is in the 3 most commonly associated
E.G(in this example, if I specified 5, it should only return record with id 2 from Table A as id 5 from table B is the only association and hence in the 3 most commonly associated. It shouldn't return record with id 1 from Table A as its 3 most commonly associated are 1,2,3