Skip to content

Instantly share code, notes, and snippets.

View ErKiran's full-sized avatar
🔨
Build | Grind | Repeat

Kiran Adhikari ErKiran

🔨
Build | Grind | Repeat
View GitHub Profile
const axios = require('axios');
const fs = require('fs');
async function fetchData() {
const data = [];
for (let i = 1; i < 8; i++) {
const response = await axios.get(`https://result.election.gov.np/JSONFiles/JSONMap/geojson/District/STATE_C_${i}.json`);
const features = response.data.features;
await Promise.all(features.map(async i => {
const { DCODE } = i.properties;
{
"t": [
1609372800,
1609632000,
1609718400,
1609804800,
1609891200,
1609977600,
1610236800,
1610323200,
const close = [
"234",
"237",
"239",
"241",
"239",
"240",
"248",
"250",
"254",
const close = [
"217",
"220",
"220",
"218",
"221",
"219",
"228",
"239",
"237",
@ErKiran
ErKiran / gist:1dc4161ee98f29ca9cb80f24d0fc2ce0
Created November 28, 2019 18:39
CombineArrayOfObject.js
const data = [
{
date:"2019-11-18",
gender:"male",
count:5
},
{
date:"2019-11-18",
gender:"female",
count:10
@ErKiran
ErKiran / understanding-word-vectors.ipynb
Created October 19, 2019 13:30 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
process.env["NTBA_FIX_319"] = 1;
const TelegramBot = require('node-telegram-bot-api');
const config = require('../config/key')
const bot = new TelegramBot(config.TOKEN, {
polling: true,
onlyFirstMatch: true
});
module.exports = {
@ErKiran
ErKiran / SpotifyAxios.js
Created May 26, 2019 12:49
How to call Spotify API using Axios?
async CallAxios(){
const options = {
method: 'GET',
url: `https://api.spotify.com/v1/search?q=${this.state.query}&type=track`,
headers: {
'Authorization': `Bearer ${config.Bearer}`,
"Accept": "application/json",
"Content-Type": "application/json",
}
}
@ErKiran
ErKiran / cheatJson.md
Last active May 25, 2019 08:26
JSON Cheat Sheet

How to remove certain element from JSON array?

const JsonArray=[
    {
        "Name": "Hatuwagadhi",
        "Nepali": "हतुवागढी",
        "Districts": "Bhojpur",
        "Population (2011)": "20,404",
        "Area (KM2)": "142.61",
 "Density": "143",