Skip to content

Instantly share code, notes, and snippets.

View LukeAims's full-sized avatar
:electron:
Building anything and everything to build my skills

Luke Aimson LukeAims

:electron:
Building anything and everything to build my skills
View GitHub Profile
@LukeAims
LukeAims / .zlogout
Last active June 1, 2023 23:57
dotfiles (Work in progress)
#!/usr/bin/env bash
##############################################################################################################
# **** Clean exit **** #
##############################################################################################################
# Clear console on exit
[ "$SHLVL" == 1 ] \
&& clear &> /dev/null
@LukeAims
LukeAims / LC_COLORS.md
Created May 11, 2023 00:52 — forked from thomd/LC_COLORS.md
LSCOLORS & LS_COLORS

alternatively use: http://geoff.greer.fm/lscolors/

LSCOLORS

The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color.

The color designators are as follows:

a black

@LukeAims
LukeAims / android.css
Created April 24, 2023 16:25
Android Logo in HTML and CSS
div {margin: o; padding: 0;}
div div {background: #A4CA39; position: relative;}
.android{
height: 404px; width: 334px;
margin: 100px auto;
}
.head{
width: 220px; height: 100px;
@LukeAims
LukeAims / R_P_S.sh
Created April 7, 2019 13:08
Rock/Paper/Scissors Game in Bash
#!/bin/bash
echo "What will you choose? [rock/paper/scissors]"
read response
aiThought=$(echo $[ 1 + $[ RANDOM % 3 ]])
case $aiThought in
1) aiResponse="rock" ;;
2) aiResponse="paper" ;;
3) aiResponse="scissors" ;;
esac
echo "AI - $aiResponse"
// number > 1 is a prime if it can’t be evenly divided by anything except 1 and n.
// define var n
let n = 1000;
nextPrime:
for (let i = 2; i <= n; i++) { // for each i do...
for (let j = 2; j < i; j++) { // look for a divisor..
if (i % j == 0) continue nextPrime; // not a prime, go next i
@LukeAims
LukeAims / add100ToArray.js
Created April 3, 2019 21:42
Programming Quiz: Another Type of Loop (6-8)
/*
* Programming Quiz: Another Type of Loop (6-8)
*
* Use the existing `test` variable and write a `forEach` loop
* that adds 100 to each number that is divisible by 3.
*
* Things to note:
* - you must use an `if` statement to verify code is divisible by 3
* - you can use `console.log` to verify the `test` variable when you're finished looping
*/
@LukeAims
LukeAims / quidditchCup.js
Created April 3, 2019 20:46
Programming Quiz: Quidditch Cup (6-5)
/*
* Programming Quiz: Quidditch Cup (6-5)
*/
// your code goes here
var team = ["Oliver Wood", "Angelina Johnson", "Katie Bell", "Alicia Spinnet", "George Weasley", "Fred Weasley", "Harry Potter"];
function hasEnoughPlayers(team) {
players = team.length >= 7 ? true : false;
@LukeAims
LukeAims / rainbow.js
Created April 3, 2019 18:43
Programming Quiz: Colors of the Rainbow (6-4)
/*
* Programming Quiz: Colors of the Rainbow (6-4)
*
* Use only the splice() method to modify the rainbow variable:
* - remove "Blackberry"
* - add "Yellow" and "Green"
* - add "Purple"
*/
var rainbow = ['Red', 'Orange', 'Blackberry', 'Blue'];
@LukeAims
LukeAims / emotions.js
Created April 3, 2019 17:10
Programming Quiz: Inline Functions (5-6)
/*
* Programming Quiz: Inline Functions (5-6)
*/
// don't change this code
function emotions(myString, myFunc) {
console.log("I am " + myString + ", " + myFunc(2));
}
// your code goes here
@LukeAims
LukeAims / laugh.js
Created April 3, 2019 16:33
Programming Quiz: Laugh (5-4)
/*
* Programming Quiz: Laugh (5-4)
*/
var laugh = function(numOfHa) {
var word = "";
for (i = 0; i < numOfHa; i++) {
word += 'ha';
} return `${word}!`;
};