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
defmodule Coalesce do | |
@moduledoc """ | |
Provides a "coalesce" macro. | |
This macro is partly inspired by the COALESCE function in the SQL-92 standard. | |
The original COALESCE function is a function that returns the first non-null | |
computed expression passed as one of its argument, or NULL itself if no such | |
expression is found. |
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 <stdbool.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <libgen.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <pwd.h> |
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 | |
# Script depends on whatever WEBrick has in Ruby 2.2.3 | |
# Includes for convenience | |
require 'webrick' | |
include WEBrick | |
# Initialize plain server, no indexing, else CGI handling will be broken | |
s = HTTPServer.new( |
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 'date' | |
require 'rubygems' | |
require 'mechanize' | |
require 'concurrent' | |
require 'daybreak' | |
require 'thread' | |
require 'pry' | |
Promise = Concurrent::Promise |
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
package persistence.utility; | |
public class Cripto { | |
public static String encodeString(String s){ | |
//TODO: encode password here | |
return s; | |
} | |
} |
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
gem 'activerecord', '4.1.0' | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# Ensure backward compatibility with Minitest 4 | |
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') |