This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from "fs"; | |
import { Keypair } from "stellar-sdk"; | |
const END_WITH = "PAL"; | |
const COUNT = 2; | |
const OUTPUT_FILE = "./keys.json"; | |
let foundCounter = 0; | |
let foundKeys = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8; | |
interface CErc20 { | |
function balanceOf(address) external view returns (uint); | |
function mint(uint) external returns (uint); | |
function exchangeRateCurrent() external returns (uint); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ga='git add' | |
alias gaa='git add .' | |
alias gst='git status' | |
alias gcam='git commit -m' | |
alias gp='git push' | |
alias gl='git pull' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
"strings" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def digitPower(num): | |
numString = str(num) | |
su = 0 | |
for j in range(0, len(numString)): | |
su += int(numString[j]) ** 5 | |
if num == su: | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
combinations = [] | |
for i in range(2, 101): | |
for j in range(2, 101): | |
p = i ** j | |
if p not in combinations: | |
combinations.append(p) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import moment from 'moment-jalaali'; | |
moment.loadPersian({ usePersianDigits: true, dialect: 'persian-modern' }); | |
const persianDate = date => moment(date).fromNow(); | |
export default persianDate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crypto from 'crypto'; | |
import multer from 'multer'; | |
const storage = multer.diskStorage({ | |
destination(req, file, cb) { | |
cb(null, './uploads/'); | |
}, | |
filename(req, file, cb) { | |
crypto.pseudoRandomBytes(16, (err, raw) => { | |
const extension = file.mimetype.split('/')[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crypto from 'crypto'; | |
import multer from 'multer'; | |
const storage = multer.diskStorage({ | |
destination(req, file, cb) { | |
cb(null, './uploads/'); | |
}, | |
filename(req, file, cb) { | |
crypto.pseudoRandomBytes(16, (err, raw) => { | |
const extension = file.mimetype.split('/')[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crypto from 'crypto'; | |
function randomString() { | |
return new Promise((resolve, reject) => { | |
crypto.pseudoRandomBytes(16, (err, raw) => { | |
if (err) { | |
reject(err); | |
} else { | |
const r = raw.toString('hex') + Date.now(); |
NewerOlder