Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

Gardner Vickers gardnervickers

😀
View GitHub Profile
View syscalls.rs
use std::{io, net};
trait RawSysCallsTraitOrSomething {
fn bind_udp(&self, addr: net::SocketAddr) -> io::Result<UdpSocket> {}
fn set_ttl_udp(&self, socket: usize, ttl: u32) -> io::Result<()> {}
fn read(&self, socket: usize, buf: &mut [u8]) -> io::Result<usize> {}
}
cfg_syscall! {
View syscalls.rs
use std::{io, net};
trait RawSysCallsTraitOrSomething {
fn bind_udp(&self, addr: net::SocketAddr) -> io::Result<UdpSocket> {}
fn set_ttl_udp(&self, socket: usize, ttl: u32) -> io::Result<()> {}
fn read(&self, socket: usize, buf: &mut [u8]) -> io::Result<usize> {}
}
cfg_syscall! {
type UdpSocket = udp::UdpSocket;
View shim.rs
//! Shim to allow using Rusoto with the new Hyper
use bytes::Bytes;
use futures::future::TryFutureExt;
use futures::TryStreamExt;
use futures::{compat::*, lock::Mutex};
use futures01;
use http::header::{HeaderName, HeaderValue};
use http::{HeaderMap, Method};
use hyper;
use rusoto_core::{
View routing.clj
(ns routing
(:require [goog.History :as h]
[om.next :as om]
[taoensso.timbre :as log]
[fulcro.client.mutations :as m]
[goog.events :as e]
[fulcro.client.core :refer [FulcroApplication]]
[clojure.string :as s])
(:import [goog History]))
View gist:13c38ff8314a8a95c565265e5f1d5179
17-01-10 21:26:17 pyroclast-peer.master-3254141342-g965r ERROR [onyx.peer.peer-group-manager:209] - Error applying log entry: {:fn :prepare-join-cluster, :args {:joiner #uuid "1052ab86-7768-48f5-addb-b098e0566104"}, :peer-parent #uuid "1052ab86-7768-48f5-addb-b098e0566104", :entry-parent 498, :message-id 500, :created-at 1484083577513} to {:exempt-tasks {#uuid "b3214b61-a47b-4638-a2ed-9db4c8fd042d" [], #uuid "bbd12879-e1f4-4aa6-86ad-99be25375ec1" [], #uuid "ad3be636-8f8b-490c-a955-77e842b4cbb2" [], #uuid "a1d53b4f-1ede-400b-b656-211ae2f9e41a" [], #uuid "c3344dd0-a939-45cc-9467-0ff43d4ed84c" [], #uuid "2e1000fc-8321-4f1e-93a1-a8c6fa48adc2" [], #uuid "400d54df-812e-46c5-95b6-60d680662e0b" [], #uuid "cfddbdb8-9bc9-4b73-b543-f40a6a142b06" [], #uuid "5e5da10e-86fb-4a1d-9145-81ab0b899074" [], #uuid "8dc017d3-1133-4f70-996f-6b52d05b2d1e" [], #uuid "fbdfe33b-d3eb-439b-8fae-5294a71beb24" [], #uuid "0f445b13-a4a5-4491-8feb-dc3215d3e101" [], #uuid "909256b5-00bf-4736-8e04-6675778524e7" [], #uuid "0a3bf02d-ff1a-4408-aafd
View gist:20b0687a75d51edd39208a4cc5e48bb8
{:fn :prepare-join-cluster, :args {:joiner #uuid "1052ab86-7768-48f5-addb-b098e0566104"}, :peer-parent #uuid "1052ab86-7768-48f5-addb-b098e0566104", :entry-parent 498, :message-id 500, :created-at 1484083577513}
=>
{:exempt-tasks {#uuid "b3214b61-a47b-4638-a2ed-9db4c8fd042d" [], #uuid "bbd12879-e1f4-4aa6-86ad-99be25375ec1" [], #uuid "ad3be636-8f8b-490c-a955-77e842b4cbb2" [], #uuid "a1d53b4f-1ede-400b-b656-211ae2f9e41a" [], #uuid "c3344dd0-a939-45cc-9467-0ff43d4ed84c" [], #uuid "2e1000fc-8321-4f1e-93a1-a8c6fa48adc2" [], #uuid "400d54df-812e-46c5-95b6-60d680662e0b" [], #uuid "cfddbdb8-9bc9-4b73-b543-f40a6a142b06" [], #uuid "5e5da10e-86fb-4a1d-9145-81ab0b899074" [], #uuid "8dc017d3-1133-4f70-996f-6b52d05b2d1e" [], #uuid "fbdfe33b-d3eb-439b-8fae-5294a71beb24" [], #uuid "0f445b13-a4a5-4491-8feb-dc3215d3e101" [], #uuid "909256b5-00bf-4736-8e04-6675778524e7" [], #uuid "0a3bf02d-ff1a-4408-aafd-93023441ef53" [], #uuid "af4270a7-09da-4fae-bc97-1be4b7e037f9" [], #uuid "ef31f32c-62c3-49f6-8c65-f5278d2fbd08" [], #uuid "b
View webpack.js
const webpack = require('webpack');
const path = require('path');
const BUILD_DIR = path.resolve(__dirname, 'resources', 'public', 'webpack');
const APP_DIR = path.resolve(__dirname, 'src', 'js');
const config = {
entry: `${APP_DIR}/main.js`,
module: {
loaders: [
View problem.clj
(ns cards.query-key-appstate-bug
(:require [untangled.client.cards :as uccards :include-macros true]
[devcards.core :as dc :refer-macros [defcard]]
[untangled.client.core :as uc :refer [initial-state InitialAppState]]
[om.next :as om :refer [defui]]
[om.dom :as dom]
[untangled.client.mutations :as m]
[clojure.string :as string]
[untangled.client.logging :as log]))
View *.clj
(let [s (re-seq #"\d+" "401-477-0248")]
(println (reduce (fn [acc v]
(if (and (seq acc)
(every? (fn [pastv]
(= pastv ["" nil])) (take-last 10 acc)))
(reduced acc)
(conj acc v))) [] s)))
View pathopt-union-problem.cljs
(ns cards.union-follow-on-reads
(:require [devcards.core :as dc :refer-macros [defcard dom-node]]
[om.dom :as dom]
[om.next :as om :refer [defui]]
[om.util :as util]))
(defui ^:once ActiveUsersTab
static om/IQuery
(query [this] [:which-tab])