Skip to content

Instantly share code, notes, and snippets.

@rr948
rr948 / create_github_files.sh
Created January 23, 2021 12:53 — forked from aslakhellesoy/create_github_files.sh
Can't create a new empty file on GitHub using API
# This works
curl -u USER:PASS https://api.github.com/repos/USER/REPO/contents/a.txt --request PUT --data-ascii $'{"path": "a.txt", "content": "bXkgbmV3IGZpbGUgY29udGVudHM=", "message": "hello"}'
# Does not work
curl -u USER:PASS https://api.github.com/repos/USER/REPO/contents/a.txt --request PUT --data-ascii $'{"path": "a.txt", "content": "", "message": "hello"}'
# HTTP status 422. Body:
# {
# "message": "content is not valid Base64",
# "documentation_url": "http://developer.github.com/v3/repos/contents/"
@rr948
rr948 / file_list.groovy
Created August 6, 2021 19:19 — forked from yangkun/file_list.groovy
[groovy] list dirs/files (dir first and sort as name)
import groovy.io.*
def listfiles(dir) {
dlist = []
flist = []
new File(dir).eachDir {dlist << it.name }
dlist.sort()
new File(dir).eachFile(FileType.FILES, {flist << it.name })
flist.sort()
return (dlist << flist).flatten()
@rr948
rr948 / .block
Created September 29, 2021 22:21 — forked from mbostock/.block
Radial Cluster Dendrogram
license: gpl-3.0
height: 950
border: no
<!DOCTYPE html>
<html>
<head>
<script src="js/JQuery.js">
</script>
<script>
$(document).ready(function()
{
$("#btn1").click(function(){
$("#box").animate({height:"300px"});
@rr948
rr948 / Setting_upa_new_repo.md
Created May 18, 2022 10:08 — forked from alexpchin/Setting_upa_new_repo.md
Create a new repository on the command line

Setting up a new Git Repo

##Create a new repository on the command line

touch README.md
git init
git add README.md
git commit -m "first commit"

git remote add origin [email protected]:alexpchin/.git

@rr948
rr948 / index.html
Created September 23, 2022 00:50 — forked from JasonAGross/index.html
The multi-toggle is basically just nested accordions. The user taps on the parent category to reveal children categories underneath. Once enough screen real estate becomes available, they convert to the usual multi-level dropdown we’re used to seeing.
<!--Pattern HTML-->
<div id="pattern" class="pattern">
<!--Begin Pattern HTML-->
<button class="menu-link">Menu <span>&#9660;</span></button>
<nav id="menu" class="menu" role="navigation">
<ul class="level-1">
<!--Parent #1-->
<li class="has-subnav">
<a href="#">Parent #1</a>
<ul class="level-2">
@rr948
rr948 / index.html
Created January 8, 2023 07:39
svg line icons - collection
<div class="container">
<div class="row">
<div class="col-12 pt-4 pb-1 text-center">
<h2 class="text-primary">svg icon collection</h2>
</div>
<div class="col-12 pb-3">
<div class="form-control text-center">
<input id="search-icon" class="col-12" type="text" value="">
</div>
@rr948
rr948 / chef_local_development_workflow.md
Created April 4, 2023 12:33 — forked from smford22/chef_local_development_workflow.md
Chef Local Development Workflow - ChefDK, Vagrant, VirtualBox, Test Kitchen

Chef Local Development Workflow with ChefDK, Vagrant, VirtualBox, and Test Kitchen

Overview

The following document is intended to be a quick guide to getting you setup for doing local development with Chef. This guide was created on my MacBook, but should work fine with Linux, and Windows workstations as well.

Quick review on fundamental tenets of Chef

  • Workstation - A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery
  • Node - A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.
  • Chef Server- The Chef server acts as a hub for configuration data. The Chef server stores cookbooks, the policies that are applied to nodes, and metadata that describes each registered
@rr948
rr948 / README.md
Created May 18, 2023 07:17 — forked from robschmuecker/README.md
Drag and drop, collapsible d3.js Tree with 50,000 nodes

This is an example of a collapsible drag and drop tree implementing slightly modified code from https://gist.github.com/robschmuecker/7880033

This is posted in order to demonstrate a viable answer for a Stack Overflow question http://stackoverflow.com/questions/20539922/has-anyone-produced-a-virtualised-javascript-tree-for-thousands-of-nodes

The only difference between this gist and the one referenced above is that the JSON file has changed. Each node contains 15 children and the depth is 4. Hence over 50,000 nodes.

The performance is fine if not too many of the nodes are present at once in the DOM. The JSON was contructed at http://www.json-generator.com/ with the following markup

@rr948
rr948 / kubernetes-certifications.md
Created July 13, 2023 12:01 — forked from bakavets/kubernetes-certifications.md
How I passed Kubernetes KCNA, CKAD, CKA, and CKS exams. My experience. Exam tips and tricks.