Skip to content

Instantly share code, notes, and snippets.

View fourcolors's full-sized avatar
🎯
Perkisizing

fourcolors fourcolors

🎯
Perkisizing
View GitHub Profile
@fourcolors
fourcolors / contract.sol
Created January 21, 2024 17:11
smart contract for rentdi
//the tenants borrow gho and pays to the pool and the RentalApp contract owner keeps the moneys and earns interest
function paySecurityDeposit(address tokenAddress) public {
require(
tokenAddress == ghoAddress,
"Only gho token can be used to pay rent"
);
require(msg.sender == tenant, "Only tenant can pay security deposit");
require(leaseActive, "Lease is active");
require(
block.timestamp <= leaseStart + securityDepositDueDate,
@fourcolors
fourcolors / difference.py
Created January 26, 2021 06:25
Find the difference of two lists in python
list1 = [1,2,3,4]
list2 = [1,2,3,4,5,6]
non_matching_items = list(set(list2).difference(set(list1)))
print(non_matching_items)
# [5, 6]
@fourcolors
fourcolors / PhoneField.svelte
Last active January 20, 2020 07:30
Svelte 9 Phone Field
<script>
const digits = Array(10).fill(null);
const focusNext = i => {
const next = digits[i + 1];
if (Boolean(next)) next.focus();
};
const focusPrevious = i => {
const next = digits[i - 1];
if (Boolean(next)) next.focus();
@fourcolors
fourcolors / fish.config
Created December 4, 2019 23:34
My fish config
function bx
bundle exec $argv
end
alias fv "nvim (fzf)"
alias v "nvim"
alias vim "nvim"
alias gs "git status"
alias gtl "git log --graph --pretty=oneline --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
alias g "git"
@fourcolors
fourcolors / keybindings.json
Created December 4, 2019 22:06
VSCode Keyboard Shortcuts
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+h",
"command": "workbench.action.navigateLeft"
},
{
"key": "ctrl+l",
"command": "workbench.action.navigateRight"
},
@fourcolors
fourcolors / sync
Created December 3, 2019 08:02
VS Code Sync
sdf
{
"name": "nectarine",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-eslint": "^8.0.1",
"jest-expo": "^21.0.2",
"react-native-scripts": "1.5.0",
"react-test-renderer": "16.0.0-alpha.12"
},
@fourcolors
fourcolors / .spacemacs
Created November 30, 2017 08:51
latest
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
tab-width 2
@fourcolors
fourcolors / sort.js
Created June 21, 2017 00:51
sort problem
const sortedReference = [
'ITEM-1',
'ITEM-2',
'ITEM-3',
'ITEM-4',
'ITEM-5',
'ITEM-6',
'ITEM-7',
'ITEM-8',
'ITEM-9',