Skip to content

Instantly share code, notes, and snippets.

View 2pai's full-sized avatar

Iqbal syamil ayasy 2pai

View GitHub Profile
@2pai
2pai / refresh-metadata.js
Created May 1, 2022 04:30
A Simple script to refresh opensea metadata (Entire collection)
/* eslint-disable eqeqeq */
const rax = require('retry-axios');
const axios = require("axios").default;
axios.defaults.timeout = 30000;
rax.attach();
const STAGE = "rinkeby"; // "mainnet"
const contractAddress = "0x0000000000000000000000000000000000000000";
const fromTokenId = 0;
const toTokenId = 10000;

Code of Conduct

All attendees, members, organisers, facilitators, mentors and venue staff involved in Telkom Developers community are required to agree with the following code of conduct.

We value the diversity and inclusion of underrepresented and marginalized people in tech.

We are committed to making participation in this community a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

@2pai
2pai / .env
Created November 21, 2019 02:27
APP_PORT=3006
MONGOURI="mongodb://mongo:27017/kitten"
version: '3.7'
services:
mongo:
image: mongo:latest
container_name: mongodb
hostname: mongo
volumes:
- mongo:/data/db
restart:
always
@2pai
2pai / Dockerfile
Last active November 20, 2019 08:04
FROM node:alpine
RUN apk update && apk add ca-certificates openssl && update-ca-certificates
RUN mkdir /app
ADD . /app
WORKDIR /app
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.6.0/wait /wait
RUN chmod +x /wait
RUN npm install

Keybase proof

I hereby claim:

  • I am 2pai on github.
  • I am 2pai (https://keybase.io/2pai) on keybase.
  • I have a public key ASCaB-R5Ahw62x1m1CPimLb5bx_TJLEWu7j-h7Zqldt_OQo

To claim this, I am signing this object:

@2pai
2pai / controller.js
Last active August 5, 2019 15:23
for medium
const mongoose = require('mongoose');
const model = require('./models');
const redis = require('redis');
const client = redis.createClient();
const fetch = require('node-fetch');
require('dotenv').config()
mongoose.connect(process.env.MONGOURL, {useNewUrlParser: true});
const banner = mongoose.model('banner', model.banner,'banner');
const getBanner = (req,res) => {
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const banner = new Schema({
bannerAndroid: String,
bannerWebsite: String,
bannerAds: String,
bannerIOS: String,
});
@2pai
2pai / index.js
Created August 5, 2019 15:10
for medium
const express = require("express");
const app = new express();
const controller = require('./controller');
const port = 8025;
const bodyParser = require('body-parser');
app.enable('trust proxy'); // agar bisa mengakses IP user
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.get('/api/getInfoIP',controller.getIPInfo)
{
"name": "caching-redis-example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "2pai",
"license": "ISC",