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
#!/usr/bin/env bash | |
set -euo pipefail | |
user=ben0x539 | |
repos=( | |
$( | |
gh repo list --json name,defaultBranchRef --source \ | |
| jq --raw-output '.[] | select(.defaultBranchRef.name == "master") | .name' | |
) | |
) |
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
def reduce(n) | |
while explode(n) || split(n) | |
end | |
n | |
end | |
def explode(n) | |
i = 0 | |
depth = 0 | |
while i < n.length |
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 'json' | |
class Cell < Struct.new(:item); end | |
class Args | |
attr_reader :pos, :top | |
def initialize() | |
@pos = [] | |
@top = {} | |
@stack = [Cell.new(@top)] |
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
#if (X & (1<<0)) != 0 | |
+ 1 | |
#endif | |
#if (X & (1<<1)) != 0 | |
+ 2 | |
#endif | |
#if (X & (1<<2)) != 0 | |
+ 4 | |
#endif | |
#if (X & (1<<3)) != 0 |
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
#define NUMBER *p-- = buf; itoa(i, buf); while (*buf++); --i; | |
#define FIZZ *p-- = "Fizz"; --i; | |
#define BUZZ *p-- = "Buzz"; --i; | |
#define FIZZBUZZ *p-- = "FizzBuzz"; --i; | |
void itoa(int value, char* s) { | |
int l; | |
if (value > 9999) l = 5; | |
else if (value > 999) l = 4; | |
else if (value > 99) l = 3; |
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
#!/usr/bin/env ruby | |
# GPLv3 or at yr choice any later | |
require 'fileutils' | |
require 'json' | |
require 'open3' | |
require 'pp' | |
require 'time' | |
require 'uri' |
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
#! /usr/bin/env bash | |
set -euo pipefail | |
api() { | |
local type endpoint registry image arg url | |
type=$1 endpoint=$2 registry=$3 image=$4 arg=$5 | |
url="https://$registry/v2/$image/$endpoint/$arg" | |
curl --config - <<<"-u $ARTIFACTORY_CREDS" -H "Accept: $type" "$url" | |
} |
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
#![feature(proc_macro, drain_filter)] | |
#[crate = "0.1"] | |
extern crate failure; | |
#[crate = "0.2"] | |
extern crate structopt; | |
#[crate = "0.7"] | |
extern crate sha2; | |
#[crate = "0.5"] | |
extern crate quote; |
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
use std::fmt; | |
use serde::Deserialize; | |
extern crate serde; | |
extern crate serde_json; | |
struct Foo; | |
impl<'de> Deserialize<'de> for Foo { |
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
{ pkgs ? import <nixpkgs> { } }: | |
with pkgs; | |
stdenv.mkDerivation rec { | |
name = "gnome-builder-${version}"; | |
version = "3.25.2-a11c9dfa"; | |
buildInputs = [ | |
libxml2 desktop_file_utils llvm clang libgit2 gobjectIntrospection librsvg |
NewerOlder