Skip to content

Instantly share code, notes, and snippets.

View luisoos's full-sized avatar
:shipit:
Working from home

Luis luisoos

:shipit:
Working from home
View GitHub Profile
@luisoos
luisoos / SquareRoot.java
Last active January 12, 2022 17:26
Get the square root of a number in Java
public class Main {
public static void main(String[] args) {
System.out.println(Math.sqrt(2.5));
}
}
@luisoos
luisoos / PasswordGenerator.java
Last active January 12, 2022 17:27
Java Password Generator
import java.util.Random;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// Giving advice to user
System.out.println("How much characters should your password have?");
@luisoos
luisoos / NoRecoilScript.lua
Last active December 30, 2023 16:22
Logitech G No Recoil Script
EnablePrimaryMouseButtonEvents (true);
function OnEvent(event,arg)
if IsKeyLockOn("Capslock")then
if IsMouseButtonPressed(3)then
repeat
if IsMouseButtonPressed(1) then
repeat
MoveMouseRelative(0,1) -- This changes the "stage" of the recoil hold // 0.4 is hard, 0.1 less hard!
Sleep(9)
until not IsMouseButtonPressed(1)
@luisoos
luisoos / LastWordOfString.java
Last active January 12, 2022 17:26
Print the last word of a string in Java
String input = "This is an example with the string named input";
int position = input.lastIndexOf(" "); // Get last space
position++; // Jump to next character, so you skip the space
System.out.println(input.substring(position)); // Prints input
@luisoos
luisoos / Hash.java
Last active January 30, 2022 16:29
Simple Hash in Java
// These arrays will have the same hash-code.
String[] example1 = {"a", "b", "c"}; // Hash: 126145
String[] example2 = {"a", "b", "c"}; // Hash: 126145
// These arrays will NOT have the same hash-code.
String[] example1 = {"a", "b", "c"}; // Hash: 126145
String[] example2 = {"aa", "b", "c"}; // Hash: 3015872
@luisoos
luisoos / ExternalJSONtoLineChart.html
Last active April 12, 2022 12:28
Generating a line chart in Chart.js from a external JSON file in vanilla JavaScript
<!-- Importing JS -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.1/dist/chart.min.js"></script>
<script type="text/javascript" src="index.js"></script>
@luisoos
luisoos / SaveToJSON.js
Created April 12, 2022 12:29
Node.js program that saves data to an external json file
var fs = require('fs');
var obj = {
date: date,
speed: speed
}
data.push(obj)
@luisoos
luisoos / index.css
Created October 19, 2022 17:34
My Tailwind CSS Starter Functions
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
html {
-webkit-tap-highlight-color: transparent;
}
}