Skip to content

Instantly share code, notes, and snippets.

CapacitorSet CapacitorSet

Block or report user

Report or block CapacitorSet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@CapacitorSet
CapacitorSet / add8.cpp
Created Sep 10, 2019
8 bit adder for Glovebox
View add8.cpp
void add8(gb::bitvec<8> out, bit_t overflow, const gb::bitvec<8> a,
const gb::bitvec<8> b) {
bit_t _00_ = make_bit();
_nor(_00_, a[7], b[7]);
bit_t _01_ = make_bit();
_nand(_01_, a[6], b[6]);
bit_t _02_ = make_bit();
_nand(_02_, a[5], b[5]);
bit_t _03_ = make_bit();
_nand(_03_, a[4], b[4]);
@CapacitorSet
CapacitorSet / webhook-server.go
Created Mar 11, 2019
A tiny webhook server that runs a bash script upon pushes to master.
View webhook-server.go
package main
import (
"log"
"net/http"
"os"
"os/exec"
"gopkg.in/go-playground/webhooks.v5/github"
)
@CapacitorSet
CapacitorSet / oid.go
Created Jul 8, 2018
Parse OIDs in Go
View oid.go
// https://www.snmpsharpnet.com/?p=153
oid := []uint32{
uint32(oidBytes[0]) / 40,
uint32(oidBytes[0]) % 40,
}
for i := 1; i < len(oidBytes); {
bbyte := oidBytes[i]
// Short form
if bbyte & 0x80 == 0 {
oid = append(oid, uint32(bbyte))
View uglify.js
// A standalone script that replicates the preprocessing stage in box-js.
const unsafe = true;
const code = require("fs").readFileSync(process.argv[2], "utf8");
const result = require("uglify-es").minify(code, {
compress: {
passes: 3,
booleans: true,
cascade: true,
View Lancio della moneta.au3
; Note: this is my first AutoIt script, which I archived for historical reasons.
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.6.0
Author: myName
Script Function:
Template AutoIt script.
View spawnSync.js
// Source: https://github.com/nodejs/node/blob/master/lib/child_process.js
// Defines spawn_sync and normalizeSpawnArguments (without error handling). These are internal variables.
spawn_sync = process.binding('spawn_sync'); normalizeSpawnArguments = function(c,b,a){if(Array.isArray(b)?b=b.slice(0):(a=b,b=[]),a===undefined&&(a={}),a=Object.assign({},a),a.shell){const g=[c].concat(b).join(' ');typeof a.shell==='string'?c=a.shell:c='/bin/sh',b=['-c',g];}typeof a.argv0==='string'?b.unshift(a.argv0):b.unshift(c);var d=a.env||process.env;var e=[];for(var f in d)e.push(f+'='+d[f]);return{file:c,args:b,options:a,envPairs:e};}
// Defines spawnSync, the function that will do the actual spawning
spawnSync = function(){var d=normalizeSpawnArguments.apply(null,arguments);var a=d.options;var c;if(a.file=d.file,a.args=d.args,a.envPairs=d.envPairs,a.stdio=[{type:'pipe',readable:!0,writable:!1},{type:'pipe',readable:!1,writable:!0},{type:'pipe',readable:!1,writable:!0}],a.input){var g=a.stdio[0]=util._extend({},a.stdio[0])
View server.go
// A one-time server. It serves a file with the format "uuid.7z.dat" and deletes it after 5 minutes since the first access.
/*
Copyright 2017 CapacitorSet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
View .clang-format
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
View keybase.md

Keybase proof

I hereby claim:

  • I am capacitorset on github.
  • I am capacitorset (https://keybase.io/capacitorset) on keybase.
  • I have a public key ASDkwL4VZiUCkNR7yfFYv8c1Iz27eKKNds3VF7yhNadM1Ao

To claim this, I am signing this object:

View Mandelbrot_seq.r
library(caTools) # external package providing write.gif function
jet.colors = colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F",
"yellow", "#FF7F00", "red", "#7F0000"))
m = 4000 # define size
C = complex( real=rep(seq(-1.8,0.6, length.out=m), each=m ),
imag=rep(seq(-1.2,1.2, length.out=m), m ) )
C = matrix(C,m,m) # reshape as square matrix of complex numbers
Z = 0 # initialize Z to zero
X = array(0, c(m,m)) # initialize output 2D array
for (k in 1:20) { # loop with 20 iterations
You can’t perform that action at this time.