Skip to content

Instantly share code, notes, and snippets.

View deadcoder0904's full-sized avatar
:octocat:
Dead

a2k deadcoder0904

:octocat:
Dead
View GitHub Profile
@deadcoder0904
deadcoder0904 / affiliate.server.ts
Created March 27, 2024 05:04
Affiliate/Referral Management System with MLM support
import { relations, sql } from "drizzle-orm"
import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core"
import { ulid } from "ulidx"
export const affiliatesTable = sqliteTable(
"affiliate",
{
id: text("id")
.primaryKey()
.$defaultFn(() => ulid()),
// Add script in console.
// var _cScript = document.createElement('script');_cScript.src='../../../tools/custom.js';document.head.appendChild(_cScript);
// ==================================================
function sequenceClass() {
this.init = function () {
var tClass = document.getElementsByClassName('t');
for (var i = 0; i < tClass.length; i++) {
tClass[i].style.boxShadow = '0px 0px 10px 2px #000000';
tClass[i].setAttribute('aria-hidden', 'true');
tClass[i].onclick = mouseEvent;
@deadcoder0904
deadcoder0904 / README.md
Last active April 5, 2019 06:25
Automate boring tasks with DOM Testing Library by Kent C Dodds

Automate boring tasks with DOM Testing Library by Kent C Dodds

Watch the video for which tasks to automate

@deadcoder0904
deadcoder0904 / App.js
Created January 12, 2019 06:17
React Native Simple Form
class Form extends React.Component {
constructor(props) {
super(props);
this.state = {
name: "",
email: "",
};
}
_storeInput = (key, value) => {
@deadcoder0904
deadcoder0904 / hack.js
Created February 12, 2018 20:14
Unfollow everyone on Github
[...document.querySelectorAll('.btn.btn-sm.js-toggler-target')].map(a => a.click())
@deadcoder0904
deadcoder0904 / app.js
Last active October 27, 2017 12:33
Get Country Codes & Flags of Countires w.r.t Country Codes
// Get country codes & flag of countries with respect to country codes
const fetch = require("node-fetch");
const NEW_LINES = `\n\n`;
const EMOJIS = `${NEW_LINES}๐Ÿ˜€ ๐Ÿ˜ƒ ๐Ÿ˜„ ๐Ÿ˜ ๐Ÿ˜† ๐Ÿ˜… ๐Ÿ˜‚ ๐Ÿคฃ โ˜บ๏ธ ๐Ÿ˜Š ๐Ÿ˜‡ ๐Ÿ™‚ ๐Ÿ™ƒ ๐Ÿ˜‰ ๐Ÿ˜Œ ๐Ÿ˜ ๐Ÿ˜˜ ๐Ÿ˜— ๐Ÿ˜™ ๐Ÿ˜š ๐Ÿ˜‹ ๐Ÿ˜œ ๐Ÿ˜ ๐Ÿ˜› ๐Ÿค‘ ๐Ÿค— ๐Ÿค“ ๐Ÿ˜Ž ๐Ÿคก ๐Ÿค  ๐Ÿ˜ ๐Ÿ˜’ ๐Ÿ˜ž ๐Ÿ˜” ๐Ÿ˜Ÿ ๐Ÿ˜• ๐Ÿ™ โ˜น๏ธ ๐Ÿ˜ฃ ๐Ÿ˜– ๐Ÿ˜ซ ๐Ÿ˜ฉ ๐Ÿ˜ค ๐Ÿ˜  ๐Ÿ˜ก ๐Ÿ˜ถ ๐Ÿ˜ ๐Ÿ˜‘ ๐Ÿ˜ฏ ๐Ÿ˜ฆ ๐Ÿ˜ง ๐Ÿ˜ฎ ๐Ÿ˜ฒ ๐Ÿ˜ต ๐Ÿ˜ณ ๐Ÿ˜ฑ ๐Ÿ˜จ ๐Ÿ˜ฐ ๐Ÿ˜ข ๐Ÿ˜ฅ ๐Ÿคค ๐Ÿ˜ญ ๐Ÿ˜“ ๐Ÿ˜ช ๐Ÿ˜ด ๐Ÿ™„ ๐Ÿค” ๐Ÿคฅ ๐Ÿ˜ฌ ๐Ÿค ๐Ÿคข ๐Ÿคง ๐Ÿ˜ท ๐Ÿค’ ๐Ÿค• ๐Ÿ˜ˆ ๐Ÿ‘ฟ ๐Ÿ‘น ๐Ÿ‘บ ๐Ÿ’ฉ ๐Ÿ‘ป ๐Ÿ’€ โ˜ ๏ธ ๐Ÿ‘ฝ ๐Ÿ‘พ ๐Ÿค– ๐ŸŽƒ ๐Ÿ˜บ ๐Ÿ˜ธ ๐Ÿ˜น ๐Ÿ˜ป ๐Ÿ˜ผ${NEW_LINES}`;
const FIXER_URI = "https://api.fixer.io/latest";
const REST_COUNTRIES_URI = "https://restcountries.eu/rest/v2/alpha/";
const COUNTRY_URI = "http://country.io/currency.json";
let currencyCodes = [];
let currencyOfCountry = [];
const flagsWithCurrencies = {};
@deadcoder0904
deadcoder0904 / allThemes.json
Last active April 14, 2021 01:35
Color Names for Theme with RGB values
[
{
"name": "Air Force blue",
"value": "#5d8aa8"
},
{
"name": "Alice blue",
"value": "#f0f8ff"
},
{
@deadcoder0904
deadcoder0904 / eslintrc.md
Last active October 14, 2017 09:51
ESLINT CONFIG

Step 1ย : Install eslint & babel-eslint

yarn add eslint babel-eslint -D

Step 2ย : Startย setup

./node_modules/.bin/eslint --init

Step 3ย : Add the following to .eslintrc.json

@deadcoder0904
deadcoder0904 / keywords.js
Created July 12, 2017 10:42
Keywords Everywhere get only keywords in an array format
var sorting = document.querySelectorAll('td');
var keywords = [];
sorting.forEach((keyword, i) => {
if((i - 1) % 8 === 0) keywords.push(keyword.innerHTML);
});
console.log(JSON.stringify(keywords, null, 2));