Skip to content

Instantly share code, notes, and snippets.

View nekofar's full-sized avatar
💭
I may be slow to respond.

Milad Nekofar nekofar

💭
I may be slow to respond.
View GitHub Profile
// ...
function _createAuction() internal {
uint256 nounId;
// Check if the auction contract itself has any Noun tokens
uint256 auctionContractNounCount = nouns.balanceOf(address(this));
if (auctionContractNounCount > 0) {
// Use the first Noun token found in the auction contract
nounId = nouns.tokenOfOwnerByIndex(address(this), 0);
@nekofar
nekofar / getTextDirection.js
Created April 1, 2023 11:10
To determine if a text is in an RTL or LTR language, you can analyze the text's Unicode character set.
function getTextDirection(text) {
// Regular expression to match RTL Unicode characters
var rtlChars = /[\u0600-\u06FF\u0750-\u077F\u0590-\u05FF\u08A0-\u08FF\uFB50-\uFDCF\uFDF0-\uFDFF\uFE70-\uFEFF]/;
// Regular expression to match LTR Unicode characters
var ltrChars = /[\u0000-\u05FF\u0700-\u08FF\uFB00-\uFB4F\uFB50-\uFDFF\uFE70-\uFEFF]/;
// Count the number of RTL and LTR characters in the text
var rtlCount = (text.match(rtlChars) || []).length;
var ltrCount = (text.match(ltrChars) || []).length;
I am attesting that this GitHub handle nekofar is linked to the Tezos account tz1fUwbK3ucKVK7CKP1NKV5rAeFqa9dXKTPA for tzprofiles
sig:edsigtbSqvp8STDf1eHQHtdpSb5cdX3zzJCrSPiWKqGk8JRDEWbPdWz3osEHWUF5LVuMe5HUp89LJQzTbe4zk6EdfLwdC9xDmfd
@nekofar
nekofar / brew-sync.sh
Last active November 21, 2021 07:11 — forked from witt3rd/brew-sync.sh
Sync Homebrew installations between Macs via Dropbox
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
@nekofar
nekofar / ZibArchive.json
Last active September 25, 2020 11:00
ZibArchive for Carthage
{
"1.1.0":"https://github.com/ZipArchive/ZipArchive/releases/download/v1.1/ZipArchive.framework.zip",
"1.2.0":"https://github.com/ZipArchive/ZipArchive/releases/download/v1.2/ZipArchive.framework.zip",
"1.3.0":"https://github.com/ZipArchive/ZipArchive/releases/download/v1.3/ZipArchive.framework.zip",
"1.4.0":"https://github.com/ZipArchive/ZipArchive/releases/download/v1.4/ZipArchive.framework.zip",
"1.5.0":"https://github.com/ZipArchive/ZipArchive/releases/download/v1.5/ZipArchive.framework.zip",
"1.6.0":"https://github.com/ZipArchive/ZipArchive/releases/download/v1.6/ZipArchive.framework.zip",
"1.6.1":"https://github.com/ZipArchive/ZipArchive/releases/download/v1.6.1/ZipArchive.framework.zip",
"1.6.2":"https://github.com/ZipArchive/ZipArchive/releases/download/v1.6.2/ZipArchive.framework.zip",
"1.7.0":"https://github.com/ZipArchive/ZipArchive/releases/download/v1.7/ZipArchive.framework.zip",
@nekofar
nekofar / ui-widget-select.sh
Created September 20, 2020 21:43 — forked from blurayne/ui-widget-select.sh
Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes)
#!/bin/bash
##
# Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes)
#
# Author: Markus Geiger <mg@evolution515.net>
# Last revised 2019-09-11
#
# ATTENTION! TO BE REFACTORED! FIRST DRAFT!
#
@nekofar
nekofar / FacebookSDK.json
Created August 28, 2020 19:11
Facebook SDK for Carthage
{
"5.3.0": "https://github.com/facebook/facebook-ios-sdk/releases/download/v5.3.0/FacebookSDK_Static.zip",
"5.4.0": "https://github.com/facebook/facebook-ios-sdk/releases/download/v5.4.0/FacebookSDK_Static.zip",
"5.4.1": "https://github.com/facebook/facebook-ios-sdk/releases/download/v5.4.1/FacebookSDK_Static.zip",
"5.5.0": "https://github.com/facebook/facebook-ios-sdk/releases/download/v5.5.0/FacebookSDK_Static.zip",
"5.6.0": "https://github.com/facebook/facebook-ios-sdk/releases/download/v5.6.0/FacebookSDK_Static.zip",
"5.7.0": "https://github.com/facebook/facebook-ios-sdk/releases/download/v5.7.0/FacebookSDK_Static.zip",
"5.8.0": "https://github.com/facebook/facebook-ios-sdk/releases/download/v5.8.0/FacebookSDK_Static.zip",
"5.9.0": "https://github.com/facebook/facebook-ios-sdk/releases/download/v5.9.0/FacebookSDK_Static.zip",
"5.10.0": "https://github.com/facebook/facebook-ios-sdk/releases/download/v5.10.0/FacebookSDK_Static.zip",
@nekofar
nekofar / dangerous.go
Created September 26, 2019 09:35
Create a Twitter list of following who suspected to be dangerous (AKA Naamn).
package main
import (
"log"
"regexp"
"github.com/dghubble/go-twitter/twitter"
"github.com/dghubble/oauth1"
)
@nekofar
nekofar / admin.css
Last active June 2, 2019 17:45
Fix some styles issues on RTL languages of Enfold theme
.rtl #avia_options_page .avia_sidebar_active .avia_options_page_content {
border-left: none;
left: auto;
border-right: 1px solid #e1e1e1;
right: -1px;
}
.rtl #avia_options_page .avia_sidebar_active .avia_options_page_sidebar {
border-right: none;
border-left: 1px solid #e5e5e5;
@nekofar
nekofar / unfollowers.py
Created March 3, 2019 04:55
Create the list of unfollowers on Twitter using Python
import twitter
# Twitter username
SCREEN_NAME = 'VVVVVVVV'
# Consumer API keys
CONSUMER_KEY = 'WWWWWWWW'
CONSUMER_SECRET = 'XXXXXXXX'
# Access token & access token secret