This file contains hidden or 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 main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "flag" | |
| "time" | |
| "strconv" | |
| ) |
This file contains hidden or 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 main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "flag" | |
| "time" | |
| "strconv" | |
| "errors" | |
| ) |
This file contains hidden or 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
| /* | |
| * bpt.c | |
| */ | |
| #define Version "1.13" | |
| /* | |
| * | |
| * bpt: B+ Tree Implementation | |
| * Copyright (C) 2010 Amittai Aviram http://www.amittai.com | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
This file contains hidden or 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 'cherti/all' | |
| include Cherti | |
| def create_ad_url_override(user_id, ad_url, lang='ad') | |
| device_types = ['mobile', 'tablet', 'pc'] | |
| device_types.each do |dt| | |
| AdUrl.find_or_create(:auth_provider => User[user_id].auth_provider, :device_type => dt, :lang => lang, :url => ad_url) | |
| end | |
| end |
This file contains hidden or 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 std.stdio; | |
| import std.file, std.algorithm, std.datetime, std.range; | |
| void main() { | |
| DirEntry[] allFiles; | |
| foreach(DirEntry entry; dirEntries("/home/yannick", | |
| SpanMode.depth)) | |
| allFiles ~= entry; | |
| auto sorted = sort!((a, b) => a.size > b.size)(allFiles); |
This file contains hidden or 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 std.stdio; | |
| import std.file, std.algorithm, std.datetime, std.range; | |
| void main() { | |
| DirEntry[] allFiles; | |
| foreach(DirEntry entry; dirEntries("/home/yannick", SpanMode.depth)){ | |
| allFiles ~= entry; | |
| } | |
| auto sorted = sort!((a, b) => a.size > b.size)(allFiles); |
This file contains hidden or 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 leveldb; | |
| import std.stdio; | |
| import leveldb.writebatch; | |
| import std.bitmanip; | |
| import std.datetime; | |
| import std.random; | |
| import std.file; | |
| import std.string; | |
| import std.conv; | |
| import core.memory; |
This file contains hidden or 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 std.stdio; | |
| import leveldb; | |
| import vibe.core.concurrency; | |
| import vibe.core.core; | |
| import std.datetime; | |
| shared static int counter; | |
| shared static Task dbTask; | |
| struct Query{ Task sender; string msg;} |
This file contains hidden or 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
| struct ApiResponse{ int code; string bdy;}; | |
| static string UA = "xxx"; | |
| ApiResponse get_article(string url_part1, string url_part2) { | |
| ApiResponse ret; | |
| auto url = "http://" ~ url_part1 ~ "/blabla/" ~ url_part2; |
This file contains hidden or 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
| # | |
| # This group is read both both by the client and the server | |
| # use it for options that affect everything | |
| # | |
| [client-server] | |
| # | |
| # include all files from the config directory | |
| # | |
| !includedir /usr/local/etc/my.cnf.d |