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
When you're using UUID as primary key field your tests will be broken, so to fix it take there steps: | |
- Remove your db/schema.rb file | |
- Add the following line in your application.rb file | |
config.active_record.schema_format = :sql | |
- Then after you run your migrations and before you run rake db:test:prepare run: | |
rake db:structure:dump |
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
True and True is True | |
True and False is False | |
False and True is False | |
False and False is False | |
True or True is True | |
True or False is True | |
False or True is True | |
False or False is False |
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
window.webkitNotifications.requestPermission(function(){alert(window.webkitNotifications.checkPermission())}); |
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
add the http_proxy and https_proxy to .bashrc | |
export http_proxy='user:pass@proxy' | |
export https_proxy='user:pass@proxy' | |
sudo visudo | |
then add the following lines | |
Defaults env_keep="http_proxy" | |
Defaults env_keep="https_proxy" |
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
HTTP_STATUS_CODES = { | |
100 => 'Continue', | |
101 => 'Switching Protocols', | |
102 => 'Processing', | |
200 => 'OK', | |
201 => 'Created', | |
202 => 'Accepted', | |
203 => 'Non-Authoritative Information', | |
204 => 'No Content', | |
205 => 'Reset Content', |
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 javax.swing.JOptionPane; | |
public class MaiorMenor { | |
public static void main(String[] args) { | |
String argumento; | |
int maior = 0; | |
int menor = Integer.MAX_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
it "instantiates record with params" do | |
# require 'pry'; binding.pry | |
url = mock_model(Url) | |
post :create, :original_url => "http://example.org" | |
Url.should_receive(:new).with({"original_url" => "http://example.org"}).and_return(url) | |
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
insmod datapath/linux/openvswitch_mod.ko | |
rmmod bridge ou modprobe -r bridge | |
mkdir -p /usr/local/etc/openvswitch | |
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema | |
ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ | |
--remote=db:Open_vSwitch,manager_options \ |
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
#include <algorithm> | |
#include <cmath> | |
#include <cstdio> | |
#include <cstring> | |
using namespace std; | |
int N; | |
double dist[20][20], memo[1 << 16]; | |
double matching(int bitmask) { |
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
first_string = "amor" | |
second_string = "maro" | |
if (first_string.chars.sort == second_string.chars.sort) | |
puts "ANAGRAM" | |
else | |
puts "TRY ANOTHER WORD" | |
end |
OlderNewer