Skip to content

Instantly share code, notes, and snippets.

View heyAyushh's full-sized avatar
🎬
Hello, hello, hello.. Is there anybody in there?

Ayush heyAyushh

🎬
Hello, hello, hello.. Is there anybody in there?
View GitHub Profile
from PIL import Image, ImageDraw, ImageFont #dynamic import
filename = '1'
gif='./data/'+filename+'.gif' #1
img = Image.open(gif)
img.save('./readydata/'+filename+".png",'png', optimize=True, quality=70) #2
# Create a file in Documents to test the upload and download.
import sys
@heyAyushh
heyAyushh / convertHtmlToString.js
Last active April 29, 2019 05:41
Convert Html file to a readable form of JS. Store Html as a variable in JS.
const fs = require("fs");
var StringDecoder = require('string_decoder').StringDecoder;
var decoder = new StringDecoder('utf8');
fs.readFile("filename.html", (err, data) => {
if (err) throw err;
var textChunk = decoder.write(data);
console.log(JSON.stringify(textChunk.trim()));
});
@heyAyushh
heyAyushh / ayush-15-defbot.py
Last active January 16, 2024 19:36
AIGaming Match bot
#implemented word and Landmark Matching
#. __ __ _ _ ____
# | \/ | __ _| |_ ___| |__ / ___| __ _ _ __ ___ ___
# | |\/| |/ _` | __/ __| '_ \ | | _ / _` | '_ ` _ \ / _ \
# | | | | (_| | || (__| | | | | |_| | (_| | | | | | | __/
# |_| |_|\__,_|\__\___|_| |_| \____|\__,_|_| |_| |_|\___|
#
botName='Ayush-15-defbot'
@heyAyushh
heyAyushh / index.js
Last active November 22, 2018 21:49
Azure function which responds with cowsay.
var cowsay = require('cowsay');
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
if (req.query.text || (req.body && req.body.text)) {
context.res = {
// status: 200, /* Defaults to 200 */
body: cowsay.say({
text : req.query.text || (req.body && req.body.text),
@heyAyushh
heyAyushh / electionproblem.cpp
Created December 3, 2017 14:37
This is a question that is asked in various exams of object oriented programming and it is implemented in c++
/*==================================================================================================================+
| |
| An election is contested by five candidates. |
| The candidates are numbered 1 to 5 and the voting is done by marking the candidate number on the ballot paper. |
| Write a program to read the ballots and counts |
| the votes cast for each candidates using an array variable count. |
| In case, a number read is outside the range 1 to 5, the ballot should be considered as a 'spoilt ballot' |
| and the program should also count the number of spoilt ballots. |
|
@heyAyushh
heyAyushh / bankAccountquestion.cpp
Created December 3, 2017 14:31
This is a question that is asked in various exams of object oriented programming and it is implemented in c++
/*==========================================================================================================+
| Assume that a bank maintains two kinds of accounts for customers, |
| one called as savings account and the other as current account. |
| The savings account provides compound interest and withdrawal facilities but no cheque book facility. |
| The current account provides cheque book facility but no interest. |
| Current account holders should also maintain a minimum balance |
| and if the balance falls below this level, a service charge is imposed. |
| Create a class account that stores customer name, account number and type of account. |
| From this derive the classes curacct and savacct to make them more specific to their requirements. |
| Include necessary member fun
@heyAyushh
heyAyushh / c_cpp_properties.json
Last active November 14, 2017 13:34
.vscode configs for mac
//add username according to your own
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include/c++/4.2.1",
"/usr/local/include",
"/usr/include",
@heyAyushh
heyAyushh / wpa_supplicant.conf
Created November 11, 2017 11:51
This is the Raspberry pi zero W wifi Configuration file
country=us
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="MyNetworkSSID"
psk="Pa55w0rd1234"
}