Skip to content

Instantly share code, notes, and snippets.

View film42's full-sized avatar
✔️
Verified

Garrett Thornburg film42

✔️
Verified
View GitHub Profile
package main
import (
"fmt"
"net"
"bufio"
"net/http"
"net/http/httputil"
"io"
"time"
class YoloController < ApplicationController
include ::AsyncResponse
def index
async do
sleep 2
@yolo = "I AM ASYNC"
resume_render
//////////////////////////////////
// Test Runner Code
//////////////////////////////////
#include <stdio.h>
typedef int (test_fn_t)(void);
struct test_t {
char * name;
Benchmark.measure { 10_000.times { ActionSubscriber::Publisher.publish("test", "test", "test") } }
5.590000 2.110000 7.700000 ( 14.262266)
Benchmark.measure { 10_000.times { ActionSubscriber::Publisher.publish_async("test", "test", "test") } }
0.030000 0.000000 0.030000 ( 0.025184)
;;; ujelly-theme-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
;;;### (autoloads nil "ujelly-theme" "ujelly-theme.el" (21808 38161
;;;;;; 0 0))
;;; Generated autoloads from ujelly-theme.el
class AnyPage
attr_reader :sql
def initialize(sql, options = {})
@page_size = options.fetch(:page_size) { 1000 }
@sql = sql
@total_pages = nil
end
def self.page(sql, nth, options = {})
require "socket"
# Detect if a socket is in CLOSE_WAIT
def socket_in_close_wait?(socket)
# Will return empty string on EOF (closed socket)
socket.recv_nonblock(1, ::Socket::MSG_PEEK) == ""
rescue IO::WaitReadable
false
end
defmodule Rpc do
defmodule ServiceDirectory do
defmodule Instance do
defstruct address: nil, port: nil, expires_at: nil, uuid: nil
end
##
# USAGE:
#
# Rpc.ServiceDirectory.start_link(port: 53023)
@film42
film42 / ar.rs
Last active September 16, 2015 05:41
trait Queryable {
fn pluralized_table_name(&self) -> String;
fn predicates(&self) -> &Vec<String>;
fn has_limit(&self) -> bool {
return self.limit_value() >= 0;
}
fn limit_value(&self) -> i64;
class EnumDeliveryType < ::Protobuf::Enum
define :STANDARD, 1
define :PRIORITY, 2
define :NEXT_DAY, 3
define :OVERNIGHT, 4
end
# # # # # # # # # # # # # PART 1 # # # # # # # # # # # # #
##