Skip to content

Instantly share code, notes, and snippets.

View 1Firsts's full-sized avatar
💭
Tap to Chat!

Achmad Imannudin 1Firsts

💭
Tap to Chat!
View GitHub Profile
@1Firsts
1Firsts / download-yt.py
Created October 8, 2021 05:58
Download Video Youtube using Python
from pytube import youtube
link = input("Enter Url:")
video = youtube(link)
stream = video.stream.get_highest_resolution()
stream.download()
@1Firsts
1Firsts / kotak.html
Created October 8, 2021 06:04
Design Kotak
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
<body>
<style>
@1Firsts
1Firsts / accent-color.css
Created October 10, 2021 13:16
Accent Color
input[type="checkbox"]{
accent-color: #eb24bf;
}
@1Firsts
1Firsts / range-slider.html
Created October 10, 2021 13:17
Range Slider
<input type="range" min="1" max="100" value="75">
@1Firsts
1Firsts / css-selector.html
Created October 10, 2021 13:35
CSS Selector
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> CSS Selector</title>
</head>
<body>
<style>
body{
background-color: #f1faee;
@1Firsts
1Firsts / for-loops.php
Created October 20, 2021 10:15
For Loops Math
<!-- Sunmation (Capital Sigma) -->
<?=
sum = 0;
for(n=0; n<=4; n++){
sum += 3*n;
}
?>
<!-- Product (Capital Pi) -->
<?=
@1Firsts
1Firsts / campaignacc
Created February 2, 2022 02:48
Structure Campaign Account
pub struct CampaignAccount {
pub campaign_owner: PubKey,
pub campaign_amounts: u64,
pub campaign_descriptions: String,
pub campaign_fulfilled: u64,
@1Firsts
1Firsts / Process Instruction
Last active February 2, 2022 02:55
Writing Logic
pub fun process_instruction (
program_id : &Pubkey,
accounts : &[AccountInfo],
data :&[u8],
) -> ProgramResult
@1Firsts
1Firsts / Defining Instruction
Created February 2, 2022 02:57
Defining The Instruction
let (instruction_byte, all_other_bytes) = data.split_first().unwrap();
if *i nstruction_byte == 0{
// create campaign
}
else if *instruction_byte == 1{
@1Firsts
1Firsts / Amount
Created February 2, 2022 03:14
The next 4 bytes will be the amount.
let amount = rest_of_data
.get(..8)
.and_then(|slice| slice.try_into().ok())
.map(u64::from_le_bytes)
.unwrap();