Skip to content

Instantly share code, notes, and snippets.

View gokdayi's full-sized avatar

Ahmet Gökdayı gokdayi

View GitHub Profile
@dabit3
dabit3 / react-web3-example.js
Last active March 22, 2022 01:48
Example of connecting to an Ethereum wallet using React & Web3
import { useState, useEffect } from 'react'
import Web3 from 'web3'
const [account, setAccount] = useState(null)
let [web3, setWeb3] = useState(null)
useEffect(() => {
checkAccount()
}, [])
// invoke to connect to wallet account
@getify
getify / 1.js
Last active September 6, 2024 19:05
Converting English number sentences ("one hundred forty two point three") to numeric digits ("142.3")
convert("one hundred five"); // "105"
convert("six hundred and fifty three"); // "653"
convert("zero zero one two three"); // "123"
convert("twelve o three"); // "1203"
convert("thirteen zero nine"); // "1309"
convert("fifteen sixteen"); // "1516"
convert("fourteen ninety two"); // "1492"
convert("nineteen ten"); // "1910"
convert("twelve hundred"); // "1200"
convert("twenty three hundred"); // "2300"
@mertcangokgoz
mertcangokgoz / download-springer.sh
Created April 26, 2020 17:18
springer.com Downloader amme hizmeti
wget "https://link.springer.com/content/pdf/10.1007/978-1-4842-4932-1" -O "Programming Persistent Memory.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-15-2429-5" -O "Forensic Genetics in the Governance of Crime.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-13-8437-0" -O "Autistic Community and the Neurodiversity Movement.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-13-8491-2" -O "Updates on Myopia.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-3-030-41882-3" -O "Audacious Education Purposes.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-3-030-29509-7" -O "The Future of Software Quality Assurance.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-15-0749-6" -O "Understanding China’s School Leadership.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-981-15-3053-1" -O "Educational Change Amongst English Language College Teachers in China.pdf"
wget "https://link.springer.com/content/pdf/10.1007/978-3-03
@Coder-ACJHP
Coder-ACJHP / UICTabbarViewController.swift
Last active July 13, 2020 14:04
Fully customizable 🎨 tab bar without using storyboard or .xib files for IOS written by Swift 4
//
// ViewController.swift
// UICTabbar
//
// Created by Coder ACJHP on 2.04.2019.
// Copyright © 2019 Onur Işık. All rights reserved.
//
import UIKit
@jayphelps
jayphelps / batchsampling.js
Last active August 18, 2022 23:27
Batch Sampling Example from my talk, Real-time Insights, powered by Reactive Programming
let buffer = getWebSocket()
.bufferTime(1000);
let gate = new BehaviorSubject(true);
let batchSize = 50;
let batchSizeCounter = 0;
let results = gate
.switchMap(enabled => enabled ? buffer : Observable.never())
.do(buffer => {
@Yousha
Yousha / .gitignore
Last active August 17, 2025 12:00
.gitignore for PHP developers.
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
@walkingError
walkingError / FileUtils
Last active November 14, 2023 03:34
Get a file from Uri.
package com.jitosoft.imageloadapp.util;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () => x) {
@niusounds
niusounds / FloatSeekBar.java
Created March 12, 2014 11:50
Custom SeekBar for Android that treat its value as float type. floatMax and floatMin can be negative value.
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.SeekBar;
public class FloatSeekBar extends SeekBar {
private float max = 1.0f;
private float min = 0.0f;
public FloatSeekBar(Context context, AttributeSet attrs, int defStyle) {
@iainconnor
iainconnor / Android Studio .gitignore
Created January 24, 2014 20:20
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files