Skip to content

Instantly share code, notes, and snippets.

View bgoonz's full-sized avatar
🎯
learning

Bryan C Guner bgoonz

🎯
learning
View GitHub Profile
@Sacristan
Sacristan / push_commits_by_chunks.sh
Last active July 18, 2025 02:35
Push commits by chunks
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=10
# check if the branch exists on the remote
# if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# # if so, only push the commits that are not on the remote already
# range=$REMOTE/$BRANCH..HEAD
# else
# # else push all the commits
@jmmarco
jmmarco / App.js
Created February 19, 2020 13:02
Add React to a Website with ES6 Capabilities
import Header from "./Header"
const App = () => {
return (
<div>
<Header />
</div>
)
}
@bgoonz
bgoonz / keypress.js
Created February 21, 2021 01:20 — forked from andrew/keypress.js
var keypress = require('keypress');
// make `process.stdin` begin emitting "keypress" events
keypress(process.stdin);
// listen for the "keypress" event
process.stdin.on('keypress', function (ch, key) {
// console.log('got "keypress"', key);
if(key && key.name == 'right'){
@KadirChav
KadirChav / PY0101EN-2-3-Dictionaries.ipynb
Created April 17, 2021 09:59
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ambratolm
Ambratolm / money-raw-value.js
Last active February 23, 2022 19:09
Convert a formatted money string value (that may contain currencies, decimals, brackets ...etc) to a raw numeric value (to use it in calculations).
function moneyRawValue(value = 0, decimalSeparator = ",") {
if (typeof value === "number") return value;
const rawValue = parseFloat(
value
.replace(/\((?=\d+)(.*)\)/, "-$1")
.replace(new RegExp(`[^0-9-${decimalSeparator}]`, "g"), "")
.replace(decimalSeparator, ".")
);
return isNaN(rawValue) ? 0 : rawValue;
}
@Sasszem
Sasszem / switch.js
Created April 17, 2021 10:30
A simple experiment with JS switch-case statements
/*
Test on how are JS's switch-cases are working.
I was in an argument w/ someone saying they turn into jumptables,
so I coded this up quickly to check.
With a few calls (so JIT won't kick in) it is clear that this executes
every case every time we enter the switch, so it is clear that jump tables
are not used in general, but they still might be used as an optional optimization,
but only when possible.
*/
from pdf2image import convert_from_path
title = input("Pdf files name: ")
def menu():
global quality
print("""
Image format:
1. Very High Resolution - 700 dpi

Exercise 1

  1. Extract the contents of the zip file into a new directory and open the folder in VSCode.
  2. Initialise a new Node app in the directory. The entry point should be the existing server.js.
  3. Install Express.
  4. Create an Express app in server.js that listens on port 3000.
  5. Create a new request in Postman to make sure that the server is working.

Exercise 2