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
SQL Server on Mac via virtualization | |
Goal: I want to be able to spin up generic instances of sql server on-demand | |
Assumptions: | |
* [Windows Server 2016 Technical Preview (Core) is installed on virtualbox](http://ezeeetm.github.io/Docker-Engine-for-Windows-Server-Walkthrough/) | |
* Typical defaults: 4096MB RAM, 32 GB fixed space | |
* The image name is "sql server" | |
* The network is "bridged adapter" | |
* Guest additions are installed via `D:\VBoxWindowsAdditions.exe` |
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 ExercisesSpec where | |
import Test.Hspec | |
import Test.QuickCheck | |
import Control.Exception (evaluate) | |
import Exercises | |
main :: IO () | |
main = hspec $ do |
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
require 'spec_helper' | |
describe 'WITH RECURSIVE' do | |
# http://www.postgresql.org/docs/8.4/static/queries-with.html | |
# http://www.cybertec.at/common-mistakes-union-vs-union-all/ | |
def query(n) | |
ActiveRecord::Base.connection.exec_query( | |
<<-SQL |
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
M-D to D-M | |
:%s:\(\d\{1,2}/\)\(\d\{1,2}/\):\2\1:g | |
Discard all but the last 4 digits | |
::%s:\v.*(\d{4}):\1:g |
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
Deprecation Warnings: [35/1389] | |
Use of rspec-core's `its` method is deprecated. Use the rspec-its gem instead. Called from /Users/johnnymo87/ruby/LocalSupport/spec/mailers/admin_mailer_spec.rb:6:in `block in <top (required)>'. | |
Use of rspec-core's `its` method is deprecated. Use the rspec-its gem instead. Called from /Users/johnnymo87/ruby/LocalSupport/spec/mailers/admin_mailer_spec.rb:7:in `block in <top (required)>'. | |
Use of rspec-core's `its` method is deprecated. Use the rspec-its gem instead. Called from /Users/johnnymo87/ruby/LocalSupport/spec/mailers/admin_mailer_spec.rb:8:in `block in <top (required)>'. | |
Too many uses of deprecated 'Use of rspec-core's `its` method'. Pass `--deprecation-out` or set `config.deprecation_stream` to a file for full output. | |
`and_return` on a negative message expectation is deprecated. Called from /Users/ |
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
// without Function.prototype.bind | |
window.user = { | |
data: [ | |
{name:"T. Woods", age:37}, | |
{name:"P. Mickelson", age:43} | |
], | |
clickHandler:function(obj) { | |
return function(e) { | |
e.preventDefault(); | |
var randomNum = ((Math.random() * 2 | 0) + 1) - 1; |
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
class TwitterFetcher | |
include Sidekiq::Worker | |
include Sidetiq::Schedulable | |
recurrence { minutely(5) } | |
def perform | |
# your main method here | |
end | |
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
var str = 'argentina'; | |
for(var i = 0; i < str.length; i++) { | |
if (str[i].match(/[a-y]/i)) { | |
console.log(String.fromCharCode(str[i].charCodeAt(0) + 1)) | |
} else if (str[i] === 'z') { | |
console.log('a') | |
}; | |
}; |
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
// Uses Zepto (http://zeptojs.com/) | |
$().ready(function() { | |
var order = new (function() { | |
var __front = 1, | |
__back = -1; | |
this.front = function() { return __front }; | |
this.back = function() { return __back }; | |
this.switch = function() { | |
__front = -__front; |
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 the discussion here: https://github.com/AgileVentures/WebsiteOne/pull/417/files#discussion_r13060679 | |
class UsersController < ApplicationController | |
include Youtube | |
# other methods elided | |
def show | |
@user = User.friendly.find(params[:id]) | |
@user.extend Foo |