This component can be used on any page where you want to check if a user is logged in.
If not logged in, they will be redirected to the login page.
The useEffect
hook waits until things are ready before checking the session status
function commit() { | |
local commit_message | |
if [[ $# -eq 0 ]]; then | |
echo "Usage: commit <message>" | |
return 1 | |
fi | |
commit_message="${*:1}" |
Information is power. But like all power, there are those who want to keep it for themselves. The world’s entire scientific and cultural heritage, published over centuries in books and journals, is increasingly being digitized and locked up by a handful of private corporations. Want to read the papers featuring the most famous results of the sciences? You’ll need to send enormous amounts to publishers like Reed Elsevier. | |
There are those struggling to change this. The Open Access Movement has fought valiantly to ensure that scientists do not sign their copyrights away but instead ensure their work is published on the Internet, under terms that allow anyone to access it. But even under the best scenarios, their work will only apply to things published in the future. Everything up until now will have been lost. | |
That is too high a price to pay. Forcing academics to pay money to read the work of their colleagues? Scanning entire libraries but only allowing the folks at Google to read them? Providing scientific a |
cycles=$(system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $NF}') | |
maxcap=$(system_profiler SPPowerDataType | grep "Maximum Capacity" | awk '{print $NF}') | |
condition=$(system_profiler SPPowerDataType | grep "Condition" | awk '{print $NF}') | |
echo '{ | |
"items": [ | |
{ | |
"uid": "battery-cycles", | |
"arg": "'"$cycles"'", | |
"title": "Battery Cycles: '"$cycles"'", | |
"subtitle": "Copy Battery Cycles to Clipboard", |
#!/bin/zsh | |
# Step 1: Get the current branch name | |
current_branch=$(git symbolic-ref --short HEAD) | |
# Step 2: Determine the target branch | |
target_branch="main" # Default to "main" branch | |
if ! git show-ref --verify --quiet "refs/heads/$target_branch"; then | |
target_branch="master" # Use "master" branch if "main" doesn't exist | |
fi |
# git shortcuts | |
alias g=git | |
alias gst='git status' | |
alias ggpush='git push origin $(git rev-parse --abbrev-ref HEAD)' | |
alias ggpull='git pull origin $(git rev-parse --abbrev-ref HEAD)' | |
alias pull='ggpull' | |
alias pul='ggpull' | |
alias ggpnp='ggpull && ggpush' | |
alias gco="git checkout" | |
alias gc-='git checkout -' |
function branch() { | |
local branch_name | |
if [[ $# -eq 0 ]]; then | |
echo "Usage: branch <name>" | |
return 1 | |
fi | |
if [[ $1 =~ [^a-zA-Z0-9._-] ]]; then | |
echo "Invalid branch name: $1" | |
return 1 | |
fi |
// create an express app (import express first) | |
const app = express(); | |
// tell app to use bodyParser, I believe this still needs to be imported but it's installed with express last I checked | |
// bodyParser will help keep your incoming http POST body clean | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({extended: false})); | |
// set the view engine to be pug ONLY if you want a view engine | |
// if you're displaying static content in vue.js or React, you can just let it be HTML |
/* this version wasn't working | |
$(document).on('keydown', function(e) { | |
if (e.key == "ArrowRight" || e.key == " ") { | |
let next = $('a').filter((b, anchor) => $(anchor).text().includes('next') ) | |
next.click(); | |
} | |
}); | |
*/ | |
// working version |
Verifying my Blockstack ID is secured with the address 13LDAQ1kgtKivD4DxUVeWQrAV3kogTrtLB https://explorer.blockstack.org/address/13LDAQ1kgtKivD4DxUVeWQrAV3kogTrtLB |