Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Check if the correct number of arguments are passed
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <git-url> <path-to-directory> <target-directory>"
exit 1
fi
# Variables from arguments
GIT_URL=$1
@nicnocquee
nicnocquee / git-contributions.sh
Created December 19, 2023 14:11
Script to get git contribution stats
#!/bin/zsh
# Check if a repository path was provided
if [[ "$#" -ne 1 ]]; then
echo "Usage: $0 /path/to/git/repo"
exit 1
fi
# Assign the first argument to the variable 'repo_path'
repo_path="$1"
@nicnocquee
nicnocquee / node-tcp.js
Created April 12, 2022 03:09
simple tcp server with node.js
const Net = require("net");
// The port on which the server is listening.
const port = 8080;
// Use net.createServer() in your code. This is just for illustration purpose.
// Create a new TCP server.
const server = new Net.Server();
// The server listens to a socket for a client to make a connection request.
// Think of a socket as an end point.
server.listen(port, function () {
@nicnocquee
nicnocquee / theegg.txt
Last active May 25, 2023 18:40
The Egg
The Egg
By: Andy Weir
http://www.galactanet.com/oneoff/theegg_mod.html
You were on your way home when you died.
It was a car accident. Nothing particularly remarkable, but fatal nonetheless. You left behind a wife and two children. It was a painless death. The EMTs tried their best to save you, but to no avail. Your body was so utterly shattered you were better off, trust me.
And that’s when you met me.
“What… what happened?” You asked. “Where am I?”
“You died,” I said, matter-of-factly. No point in mincing words.
“There was a… a truck and it was skidding…”
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>Font</key>
<data>
Base 64 String
//------------------------------------------------------------------------
// The SwiftUI Lab: Advanced SwiftUI Animations
// https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths)
// https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect)
// https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier)
//------------------------------------------------------------------------
import SwiftUI
struct ContentView: View {
@nicnocquee
nicnocquee / autoconnectwifiubuntu.md
Last active April 26, 2022 04:39
Script to autoconnect wifi in Ubuntu (linux)

Autoconnect wifi ubuntu

#!/bin/bash

wlan=`/sbin/ifconfig wlan0 | grep inet\ addr | wc -l` 
if [ $wlan -eq 0 ]; then
service network-manager restart 
else
echo WIFI IS UP

fi

@nicnocquee
nicnocquee / reboot_simulator.sh
Created July 9, 2016 20:01
Boot or reboot iOS simulator
#!/bin/bash
BOOTING="Booting "
if [ $# -eq 0 ]
then
SIMULATOR=$(xcrun simctl list | grep Booted | cut -d$'\n' -f1 | cut -d "(" -f2 | cut -d ")" -f1)
if [ ! -z "$SIMULATOR" ]; then
SIMULATORNAME=$(xcrun instruments -s | grep $SIMULATOR | cut -d "[" -f1)
BOOTING="Rebooting $SIMULATORNAME"
fi
struct RegisterRequestData: Encodable {
let username: String
let email: String
let password: String
}
struct LoginResponseData: Decodable {
let jwt: String
}