Skip to content

Instantly share code, notes, and snippets.

View MinSomai's full-sized avatar
🇳🇵
from the land of Mountains, Nepal. Namaste!

Min Somai MinSomai

🇳🇵
from the land of Mountains, Nepal. Namaste!
View GitHub Profile
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
@MinSomai
MinSomai / gist:c4835967ad35e0add704e68c3712ee28
Created November 15, 2019 07:04
Successful Career Plan
1. Get Scammed
2. Go to mars
3. buy army bag
4. go for army [bharti]
5. make jokes in indian cinemas
...
@MinSomai
MinSomai / BLA13.java
Last active February 22, 2020 17:04
BLA algorithm Computer Graphics
package hw;
import java.lang.Math;
import java.applet.Applet;
import java.awt.Graphics;
import java.util.Scanner;
public class BLA13 extends Applet {
int x1, x2, y1, y2;
int a, b;
double Steps;
package hw;
import java.lang.Math;
import java.awt.Graphics;
import java.util.Scanner;
import java.applet.Applet;
public class DDA13 extends Applet {
int x1, x2, y1, y2;
package hw;
import java.awt.*;
import java.applet.*;
public class BresenhamCircleAlgorithm13 extends Applet {
@Override
public void paint(Graphics g) {
int xc,yc,r;
xc=225;
yc=225;
r=80;
package hw;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
public class TextShow13 extends JFrame{
JPanel panel;
JLabel label;
@MinSomai
MinSomai / LineJava2D13.java
Created February 22, 2020 17:47
Lines in Java 2D
package hw;
import java.awt.*;
import javax.swing.*;
import java.util.Scanner;
public class LineJava2D13 extends JPanel {
public static int x1,x2,y1,y2;
public void paintComponent(Graphics g) {
g.drawLine(x1, y1, x2, y2);
}
public static void main(String[] args) {
package hw;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Translation13 extends JPanel{
int x1=150, y1=150, x2=130, y2=130, tx=150, ty=1, px1, px2,py1, py2;
public Translation13() {
px1=x1+tx;
px2=x2+tx;
py1=y1+ty;
package hw;
import java.awt.Graphics;
import javax.swing.JFrame;
public class ScalingOrigin13 extends JFrame {
int xPoly[] = { 25, 45, 96, 110, 145, 35, 40 };
int yPoly[] = { 25, 50, 36, 66, 75, 85, 40 };
int i;
package hw;
import java.awt.*;
import java.applet.*;
public class ScalingArbitrary13 extends Applet {
@Override
public void paint(Graphics g) {
g.drawLine(100,150,100,250);
g.drawLine(100,150,250,250);
g.drawLine(100,250,250,250);