Skip to content

Instantly share code, notes, and snippets.

View TrevCan's full-sized avatar
🖖

Hector Canizales TrevCan

🖖
View GitHub Profile
@TrevCan
TrevCan / Main.java
Last active October 22, 2020 22:47
Primo
public class Main {
public static void main(String[] args) {
// write your code here
//random int between 100 - 1000
int randomNumber = (int) (Math.random() * 900 + 100);
System.out.println(isPrime(1));
System.out.println(randomNumber);
for (int i = 1; i <= randomNumber; i++) {
char printChar = isPrime(i) ? '#' : '*';
if (i % 10 == 0 && i != 0)
@TrevCan
TrevCan / simulation_simulation.iml
Created October 28, 2020 00:12
AnimalsAndInterfaces
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
@TrevCan
TrevCan / Fibonacci.java
Created November 19, 2020 01:17
fibonacci function using recursion.
package tecbot;
public class Fibonacci {
public static void main(String[] args) {
System.out.println(getFibonacci(3));
}
public static int getFibonacci(int n){
if(n > 1)
return getFibonacci(n-1)+getFibonacci(n-2);
return n;
@TrevCan
TrevCan / _vimrc
Last active February 9, 2021 01:47
@TrevCan's _vimrc config file
"ex vimrc stuff
source $VIMRUNTIME/vimrc_example.vim
" Vim-Plug Vim plugin manager
call plug#begin('$HOME/Vim/vim-plug')
" this path equals c:\users\{user}\Vim\vim-plug
" Vim-Plug declare list of plugins
@TrevCan
TrevCan / TypeClipboard.md
Last active October 22, 2023 11:47 — forked from ethack/TypeClipboard.md
type-clip: scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.

Windows

The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

@TrevCan
TrevCan / Pass-for-iOS.md
Created August 17, 2021 18:38
Guide to using the Password Store for iOS, with active synchronization between devices using git repos.

Guide to using Pass for iOS

*partly based on this wiki

@TrevCan
TrevCan / remaps
Created August 19, 2021 21:40
Remaps script to remap TAB key to Mod while pressed and TAB when released; remap CapsLock to Ctrl while pressed and ESC when released.
#!/bin/sh
[ "$1" = "-r" ] && prompt "Remap keyboard layout?" "$HOME/.local/bin/remaps_kb_layout"
# comments
# This script is called on startup to remap keys.
# Increase key speed via a rate change
xset r rate 300 50
# Map the caps lock key to super...
@TrevCan
TrevCan / keyboard.yaml
Last active October 9, 2021 06:15
udevmon sample 'catch-all' keyboard conf
# lives under /etc/interception/dual-function-keys/keyboard.yaml
#
TIMING:
TAP_MILLISEC: 200
DOUBLE_TAP_MILLISEC: 150
MAPPINGS:
- KEY: KEY_CAPSLOCK
/*
* Descripción del problema:
*
* un arquitecto quiere diseñar un programa que realice cotizaciones para impermeabilización de losas,
*
* el programa debe solicitar el largo y ancho de la losa.
*
* Sabiendo que 1 cubeta de 19 litros de impermeabilizante cuesta $920 pesos y rinde 19 m^2
* , el costo de mano de obra por metro cuadrado es de $20 pesos, el sistema deberá
* darnos lo siguiente