Skip to content

Instantly share code, notes, and snippets.

View samudary's full-sized avatar

Robyn-Dale Samuda samudary

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active July 2, 2024 23:21
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@jack-om
jack-om / pubkey-file-encryption.sh
Last active April 21, 2024 10:39
Demo of public key file encryption using the openssl CLI
#!/bin/bash
#
# This demonstrates using the `openssl` CLI to encrypt and decrypt data with
# public-key cryptography (RSA), to share data across an untrusted communication
# medium.
#
# Public keys that are used to encrypt cannot be used to decrypt, so they can
# be shared freely ("public" keys).
#
# Private keys that can decrypt data are never shared, so the data cannot be
@DavidWells
DavidWells / github-proxy-client.js
Last active June 27, 2024 14:52
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})
@DavidWells
DavidWells / simple-logger.js
Last active March 11, 2022 21:20
Simple tiny colored logged for CLIs
const process = require('process')
const styles = require('ansi-styles')
// via https://github.com/sindresorhus/is-unicode-supported/blob/main/index.js
function isUnicodeSupported() {
if (process.platform !== 'win32') return process.env.TERM !== 'linux'; // Linux console (kernel)
return Boolean(process.env.CI)
|| Boolean(process.env.WT_SESSION) // Windows Terminal
|| process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
|| process.env.TERM_PROGRAM === 'vscode' || process.env.TERM === 'xterm-256color' || process.env.TERM === 'alacritty';
@beauraF
beauraF / .github | workflows | ci.yml
Last active April 26, 2022 21:00
Simple CI workflow for Rails that run minitest and brakeman on Github Actions
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
@RohitAwate
RohitAwate / concurrency.go
Created May 2, 2019 13:36
Code from the YouTube video: Concurrency in Golang: A Simple, Practical Example (https://youtu.be/3atNYmqXyV4)
package main
import (
"fmt"
"log"
"net/http"
"os"
"sync"
)
@lpjwilson
lpjwilson / lpform.css
Created May 19, 2017 19:09
Some custom CSS to style a form to look like a Native LP form
.button,
button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
width: 100%;
display: inline-block;
height: 38px;
padding: 0 30px;
color: #f2f2f2;
@ismyrnow
ismyrnow / mac-clear-icon-cache.sh
Created May 5, 2017 19:28
Clear the icon cache on a Mac when you start seeing generic icons in Finder or the Dock
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder
@leonardofed
leonardofed / README.md
Last active July 1, 2024 09:21
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@jpalala
jpalala / how-to-setup-mac-elasticsearch.md
Created September 11, 2015 08:28
setting up elasticsearch on your mac with brew

Install va homebrew

If you don't have homebrew installed - get homebrew here

Then run: brew install elasticsearch

Configuration

Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml.