Skip to content

Instantly share code, notes, and snippets.

View TrevCan's full-sized avatar
🖖

Hector Canizales TrevCan

🖖
View GitHub Profile
@TrevCan
TrevCan / HelloAction.java
Created October 9, 2019 13:38
hello action intellij idea plugin test
import android.os.Message;
import b.d.T;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.IconLoader;
@TrevCan
TrevCan / RobotMap.java
Created December 7, 2019 16:52
robotMap Frankie
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.robot;
/**
package frc.robot.resources;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Joystick;
/**
* A Tecbot Controller is a Joystick controller in which you can get different values from your controller,
* whether it is a Ps4, Ps3, Xbox ONE, Xbox 360 or any other controller.
*/
public class TecbotController {
{
"fileName": "REVRobotics.json",
"name": "REVRobotics",
"version": "1.1.8",
"uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb",
"mavenUrls": [
"http://www.revrobotics.com/content/sw/max/sdk/maven/"
],
"jsonUrl": "http://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json",
"javaDependencies": [
class Player {
Ship s = new Ship(3, 25, 25);
Ship[] ships = new Ship[10];
public Player() {
int c = 0;
int units = 1;
// 2B: Shared drawing canvas (Client)
import processing.net.*;
Client c;
String input;
int data[];
void setup() {
size(450, 255);
@TrevCan
TrevCan / Scratch.java
Last active October 1, 2020 19:18
swap 2 variables without temp variable.
class Scratch {
public static void main(String[] args) {
double a = -9, b = -11;
System.out.println("a: " + a + "\nb: " + b);
a = a * b;
b = a/b;
a = a/b;
@TrevCan
TrevCan / RobotFactory.java
Last active October 11, 2020 03:20
Generates an FRC Robot randomly and deteremines its probability.
public class RobotFactory {
/*
Construye un programa que de manera automática determine los componentes que un robot va a tener:
1. Chasis: butterfly, dragonfly, kiwi - 3
2. Intake: rollers, claw, pneumatic claw - 3
3. Climber: pneumatic climber, belts, brute force - 3
public class IceCreamFactory {
//helado 5 estados:
/*
¬ sin hacer: 255(+35) ou 500 (+55)
¬ recipiente: cono(+5) ou vaso
¬ base 1: zarza, fresa, guanábana, maracuyá
¬ base 2: zarza, fresa, guanábana, maracuyá
¬ topping: chocolate(+5), mermelada
¬entrega
*/
@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)