Skip to content

Instantly share code, notes, and snippets.

@mdtanrikulu
mdtanrikulu / main.sh
Last active March 23, 2020 09:47
Git Monthly based Log Extractor
#!/bin/bash
# Usage
# **NOTE** Use at own risk!
# Improved version of this script: https://gist.github.com/pdobacz/90f8e204d4b2728c8b7e916f4bc279ae
# 1. checkout the desired branch in all relevant repos first!
# 2. `cd` into a dir where you can reference your repos by relative paths
# 3. ./main.sh <author> <Month Year> <Month Year> repo1 repo2 ... >
@mdtanrikulu
mdtanrikulu / install.sh
Created May 6, 2020 10:07
Golem installation script for ElementaryOS
#!/bin/bash
trap "exit" INT
# Meta information
SCRIPT_VERSION="0.1.0"
SCRIPT_AUTHOR="Karol Tomala"
# Default variables
@mdtanrikulu
mdtanrikulu / srv.js
Created January 20, 2021 10:22
Resolve SRV Record
import dns from "dns";
dns.resolveSrv("_girepo._tcp.dev.golem.network", (err, result) => {
console.log(result);
})
/* result
[
{
name: 'yacn.dev.golem.network',
@mdtanrikulu
mdtanrikulu / gpg_info.md
Created March 14, 2021 23:42
Import GPG Key from External Backup Drive to new machine (MacOS)
  • To be able to import gpg key from external drive, first copy ~/.gnupg file from external drive to the host machine (do with finder)
  • via terminal, go into copied gnupg folder and try running gpg --homedir . --list-secret-keys
  • if you able to see "key found" information with your email address you are close to import your keys
  • in case you see such warning "gpg: conversion utf-8' us-ascii' failed: illegal byte sequence gpg:" you can ignore it
  • due to change from gpg to gpg2, you may not be able to export your keys with "gpg" command so try doing the rest with "gpg2" command
  • export your private key with gpg2 --homedir . --export-secret-key YOUR_MAIL_ADDRESS > private.key (it will ask your gpg password)
  • then go to your gpg suite, press import, find "private.key" file and import it (it will ask your gpg password)
  • and you are done!
import urllib.request
import re
EMOJI_TEST_FILENAME = "emoji-test.txt"
EMOJI_DATA_URL = "https://unicode.org/Public/emoji/14.0/emoji-test.txt"
def download_latest_emoji_test_data() :
response = urllib.request.urlopen(EMOJI_DATA_URL)
emoji_test_file = response.read()
with open(EMOJI_TEST_FILENAME, "wb") as tmp_file:
@mdtanrikulu
mdtanrikulu / config-overrides.js
Created May 5, 2022 14:39 — forked from stevemu/config-overrides.js
react-app-rewired config-overrides.js for referencing folders in adjacent folder https://github.com/facebook/create-react-app/issues/9127
const { override, addWebpackAlias } = require('customize-cra');
const path = require('path');
const overridePath = (webpackConfig) => {
const oneOfRule = webpackConfig.module.rules.find((rule) => rule.oneOf);
if (oneOfRule) {
const tsxRule = oneOfRule.oneOf.find(
(rule) => rule.test && rule.test.toString().includes('tsx')
);
@mdtanrikulu
mdtanrikulu / daemon.js
Created May 12, 2022 09:57 — forked from kumatch/daemon.js
Node.js daemon example
var fs = require('fs');
var INTERVAL = 1000;
var cycle_stop = false;
var daemon = false;
var timer;
process.argv.forEach(function (arg) {
if (arg === '-d') daemon = true;
import { ENS } from "@ensdomains/ensjs"; // 3.0.0-alpha.39
import { providers } from "ethers"; // 5.7.2
const client = new ENS();
const provider = new providers.Web3Provider(window.ethereum, "goerli");
async function setENSAvatar() {
await client.setProvider(provider);
@mdtanrikulu
mdtanrikulu / dnsWireFormat.js
Created June 21, 2023 15:23
dns wire format conversion
function dnsWireFormat(domain, ttl, type, cls, address) {
let labels = domain.split(".");
let output = "";
for (let label of labels) {
output += label.length.toString(16).padStart(2, '0');
for (let char of label) {
output += char.charCodeAt(0).toString(16);
}
}

ENS Prize: $3000

The Ethereum Name Service is a decentralised naming protocol for the new internet. If your project requires users to input ETH address or display ETH address, consider integrate with ENS so that you can show human readable names.

1. Integrate with ENS (Pool prize of $1000)

Any type of ENS integration is eligible for this prize (NOTE: We do not accept projects simply hardcoding ENS names).

Please follow the quick start guide to learn how to integrate ENS names programatically.