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
open class _ComposableSearchablePushRow<T: Equatable, Cell: CellType> : TableSelectorRow<Cell, ComposableSearchableViewController<T>> where Cell: BaseCell, Cell: TypedCellType, Cell.Value == ComposableSearchableItem<T>, T: SearchableItem, T: CustomStringConvertible { | |
public required init(tag: String?) { | |
super.init(tag: tag) | |
onCreateControllerCallback = { [weak self] _ in | |
let controller = ComposableSearchableViewController<T>() | |
controller.searchPlaceholder = self?.searchPlaceholder | |
return controller | |
} |
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 gem to your Gemfile | |
gem 'multilang-hstore', '~> 1.0.0' | |
# execute bundle install |
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
/* | |
Asymmetric Encryption Sample in Node.js: Encrypt and Decrypt using Password as a key(SECRET_KEY) | |
Algorithm: des-ede3-cbc (Three key Triple-DES EDE in CBC mode) | |
johan@firebase.co | |
@thepumpkin | |
*/ | |
var assert = require('assert') | |
var crypto = require('crypto') | |
var Buffer = require('buffer').Buffer |
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
CREATE OR REPLACE FUNCTION notify_trigger() RETURNS trigger AS $$ | |
DECLARE | |
channel_name varchar DEFAULT (TG_TABLE_NAME || '_changes'); | |
BEGIN | |
IF TG_OP = 'INSERT' THEN | |
PERFORM pg_notify(channel_name, '{"id": "' || NEW.id || '"}'); | |
RETURN NEW; | |
END IF; | |
IF TG_OP = 'DELETE' THEN | |
PERFORM pg_notify(channel_name, '{"id": "' || OLD.id || '"}'); |
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 AssetHelper | |
## | |
# Renders a stylesheet asset inline. | |
def inline_stylesheet( name ) | |
content_tag :style do | |
sprockets[ "#{name}.css" ].to_s | |
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
sudo certbot certonly -d vault.reeactr.com --manual --preferred-challenges dns-01 |
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://johan.heapsource.com | |
*/ | |
import std.stdio; | |
import std.json; | |
JSONValue doc; | |
void main() { |
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
using Microsoft.WindowsAzure.ServiceRuntime; // Microsoft.WindowsAzure.ServiceRuntime.dll | |
... | |
if (RoleEnvironment.IsAvailable) { | |
// running inside Azure Fabric | |
if(RoleEnvironment.IsEmulated) { | |
// Fabric is running in Emulator |
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://blog.heapsource.com/post/71111508527/events-d | |
// | |
import std.stdio; | |
import std.string; | |
import events; | |
void main() { | |
auto event = new EventList!(string, int); |
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-parser.d example | |
// http://blog.heapsource.com/post/70495154255/announcing-http-parser-d | |
// | |
import std.stdio; | |
import http.parser.core; | |
void main() { | |
"http-parser.d in action with fixed-size Http Message Body".writeln; |
NewerOlder