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
#!/bin/bash -e | |
RED='\033[0;31m' | |
GREEN='\033[0;33m' | |
NC='\033[0m' | |
for dir in */; do | |
echo "processing $dir" | |
cd "$dir" || continue |
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 | |
require "graphql/client" | |
require "graphql/client/http" | |
require "json" | |
require 'set' | |
require 'pp' | |
MAX_PAGES = 999 |
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
const fooMembers = new Set([1,2]); | |
const barMembers = new Set([1,3]); | |
const groups: Map<Set<number>, String> = new Map(); | |
groups.set(fooMembers,"foo"); | |
groups.set(barMembers,"bar"); | |
console.log(groups.get(fooMembers)); | |
console.log(groups.get(new Set([1,2]))); |
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
#![forbid(unsafe_code)] | |
#![warn(clippy::all)] | |
#![warn(rust_2018_idioms)] | |
pub mod mymodule; | |
use std::ffi::OsString; | |
use std::fs; | |
use std::path::Path; | |
use std::path::PathBuf; | |
use std::process::Command; |
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
use regex::bytes::Regex; | |
fn main() { | |
let re = Regex::new(r"^(.*)$").unwrap(); | |
let line: Vec<u8> = vec![ | |
46, 45, 191, 87, 110, 176, 108, 158, 46, 45, 191, 87, 110, 176, 108, 158, | |
]; | |
let s = std::str::from_utf8(&line); | |
if s.is_err() { | |
println!("Error in converting from utf8:{:?}", 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
#![warn(clippy::all)] | |
#![allow(dead_code)] | |
use serde::ser::SerializeStruct; | |
use serde::ser::SerializeTuple; | |
use serde::{Serialize, Serializer}; | |
use std::fmt; | |
use std::collections::HashMap; | |
use std::fmt::Debug; |
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
extern crate actix; | |
extern crate actix_web; | |
extern crate bytes; | |
extern crate env_logger; | |
extern crate futures; | |
#[macro_use] | |
extern crate json; | |
#[macro_use] | |
extern crate serde_derive; | |
extern crate serde_json; |
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 | |
require 'graphql/client' | |
require 'graphql/client/http' | |
require 'json' | |
require 'pp' | |
require 'slop' | |
# The GraphQL gem _forces_ us to make the client a constant: | |
# https://github.com/github/graphql-client/blob/master/guides/dynamic-query-error.md |
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
#!/bin/bash -eu | |
# uses 1pass to get token from 1password vault | |
export GITHUB_API_TOKEN=`1pass "github api token"` | |
function ghapi() { | |
# escape double quotes as we need to insert the passed heredoc into a json string | |
# optionally we could build this with jq? | |
local json=$(cat | sed 's/"/\\"/g') | |
curl -sS -K <(cat <<<"header \"Authorization: token $GITHUB_API_TOKEN\"") -X POST https://api.github.com/graphql -d @- <<EOT |
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
// turn a stream into a group | |
Map<String, Long> counting = items.stream().collect( | |
Collectors.groupingBy(Item::getName, Collectors.counting())); |
NewerOlder