Skip to content

Instantly share code, notes, and snippets.


zymtx5g79k zymtx5g79k

View GitHub Profile
View gist:7190e7bb7dbb26e66be2
color: Qt.rgba(Qt.random(), Qt.random(), Qt.random(), 1)
Button {
id: button
signal pressAndHold()
Timer {
id: longPressTimer
View gist:616f6e0380a29401743368b4f6052196
'use strict';
app = angular.module('app', [
View gist:614b25a1639e4404022b7533d136b815
#!/usr/bin/env ruby
#define path
$:.unshift File.expand_path("../", __FILE__)
require 'rubygems'
require 'eventmachine'
require 'em-http'
View gist:86c520b600505230eab8ccccb458f9ab
module M
module ClassMethods
def method_a
raise "should not execute method_a"
def self.included(base)
base.extend M::ClassMethods
View gist:c6fb3b57bcd04ee8d653b8bb37eb0b37
contact_faces = ContactFace.where(phone1: phone).or(ContactFace.where(phone2: phone))
let(:book_data) { attributes_for :book }
View gist:d80b0d8bebd75978e4ec1f1421e38fb2
# frozen_string_literal: true
RSpec.configure do |rspec|
# This config option will be enabled by default on RSpec 4,
# but for reasons of backwards compatibility, you have to
# set it on RSpec 3.
# It causes the host group and examples to inherit metadata
# from the shared context.
rspec.shared_context_metadata_behavior = :apply_to_host_groups
View gist:7437eff46b7c84ac972974c6757e150e
#!/usr/bin/env ruby
# encoding: utf-8
# frozen_string_literal: true
require 'benchmark'
require 'pg'
conn = PG.connect host: '', dbname: 'dbname', user: 'root', password: 'root'
# conn = PG.connect host: '', dbname: 'dbname', user: 'postgres', password: 'postgres', port: 12548 # container
View gist:bfe1088609de35a13ab0ce98f5c7c154
(function(d) {
var wf = d.createElement('script'), s = d.scripts[0];
wf.src = '';
wf.async = true;
s.parentNode.insertBefore(wf, s);