Skip to content

Instantly share code, notes, and snippets.

View thisiskeanyvy's full-sized avatar
:atom:
working

Keany Vy KHUN thisiskeanyvy

:atom:
working
View GitHub Profile
@thisiskeanyvy
thisiskeanyvy / getBitcoinPrice.js
Created August 2, 2022 20:57
API Bitcoin Price (coindesk)
function getBitcoinPrice() {
//make a request to the api
$.ajax({
url: "https://api.coindesk.com/v1/bpi/currentprice.json",
success: function(data) {
//parse the data
var bitcoinPrice = data.bpi.USD.rate;
//display the data
$("#bitcoin-price").html(bitcoinPrice);
}
@thisiskeanyvy
thisiskeanyvy / rockPaperScissors.js
Created August 2, 2022 20:53
Rock Paper Scissors (2 players)
function rockPaperScissors() {
var player1 = prompt("Player 1, choose rock, paper, or scissors");
var player2 = prompt("Player 2, choose rock, paper, or scissors");
if (player1 === player2) {
alert("It's a tie!");
} else if (player1 === "rock") {
if (player2 === "scissors") {
alert("Player 1 wins!");
} else {
alert("Player 2 wins!");
@-webkit-keyframes hideThenRecreate {
from {
visibility: hidden;
}
to {
visibility: visible;
}
}
@keyframes hideThenRecreate {
@thisiskeanyvy
thisiskeanyvy / dl.py
Created October 5, 2021 15:24
Download Books
import json, requests, os
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
if not os.path.exists("livre"):
os.makedirs("livre")
with open("pages.json") as file:
tab = json.loads(file.read())
@thisiskeanyvy
thisiskeanyvy / autopost.py
Created October 5, 2021 15:21
Instagram autopost
import config
import urllib.request
from datetime import date
from instabot import Bot
#variables
today = date.today();
bot = Bot()
bot.login(username = "yourusername", password = "yourpassword");
@thisiskeanyvy
thisiskeanyvy / randlike.py
Created October 5, 2021 15:18
Github autolike
"""
Code by: Keany Vy KHUN
Description: Call github api to GET random repo
"""
#pip3 install selenium
#pip3 install requests
#pip3 install json
"""
@thisiskeanyvy
thisiskeanyvy / ent_auth.py
Last active July 31, 2022 20:15
Un script pour se connecter à l'ent via une requête POST
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
# remove ssl certificate
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
# ent login
username=""
password=""
@thisiskeanyvy
thisiskeanyvy / GithubRandRepo.py
Last active July 31, 2022 20:14
add comment
"""
Code by: Keany Vy KHUN
Description: Call github api to GET random repo
"""
import requests, json
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from time import sleep
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
@thisiskeanyvy
thisiskeanyvy / unsplash.py
Created May 15, 2021 19:16
Générateur d'images aléatoires, implémenté avec l'api unsplash
import random, os, urllib.request
nbdownload = 100 #nombre d'images à générer
def program():
init()
download()
def init():
print("""
@thisiskeanyvy
thisiskeanyvy / resetPlateau.gs
Last active July 31, 2022 20:15
BrainPower script de reset des positions pour google sheet
//Script de reset des position
function resetPlateau() {
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getDataRange().getValues();
for(var i = 4; i < 20; i++) {
//Logger.log('Get num :' + data[i][0]);
var num = i - 4;
var tab = i + 1;
//Tableau Millitaire