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
Kind regards |
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
color: Qt.rgba(Qt.random(), Qt.random(), Qt.random(), 1) | |
Button { | |
id: button | |
signal pressAndHold() | |
Timer { | |
id: longPressTimer |
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'; | |
app = angular.module('app', [ | |
'ngRoute', | |
'ngResource', | |
'templates', | |
'angularFileUpload' | |
]) |
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
#!/usr/bin/env ruby | |
#define path | |
$:.unshift File.expand_path("../", __FILE__) | |
require 'rubygems' | |
require 'eventmachine' | |
#Faster | |
require 'em-http' |
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
sudo su - postgres | |
# Create dump to file | |
/usr/pgsql-9.5/bin/pg_dump --no-owner --no-acl some_db > /tmp/some_db | |
# Import from file | |
psql --username=root some_db < /tmp/some_db | |
--------------------------------------------------- | |
sudo su - postgres | |
psql | |
CREATE ROLE postgres_user WITH CREATEDB ENCRYPTED PASSWORD 'password' LOGIN; # don't user upcase in role name! |
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
contact_faces = ContactFace.where(phone1: phone).or(ContactFace.where(phone2: phone)) | |
let(:book_data) { attributes_for :book } |
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
module M | |
module ClassMethods | |
def method_a | |
raise "should not execute method_a" | |
end | |
end | |
def self.included(base) | |
base.extend M::ClassMethods | |
end |
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
# 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 |
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
filter_index = vm.filters.indexOf filter |
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# frozen_string_literal: true | |
require 'benchmark' | |
require 'pg' | |
conn = PG.connect host: '127.0.0.1', dbname: 'dbname', user: 'root', password: 'root' | |
# conn = PG.connect host: '127.0.0.1', dbname: 'dbname', user: 'postgres', password: 'postgres', port: 12548 # container |
OlderNewer