Skip to content

Instantly share code, notes, and snippets.

View arsho's full-sized avatar

Ahmedur Rahman Shovon arsho

View GitHub Profile
@Softwave
Softwave / README.md
Last active February 22, 2025 20:13
Fibonacci Program

Fib

Simple fibonacci number calculator.

Usage: fib nth Fibonacci number

@rvanbruggen
rvanbruggen / 1-contacttracing-import.cql
Last active August 18, 2022 16:11
Contact tracing example #cypher #neo4j
//environment: Neo4j Desktop 1.2.7, Neo4j Enteprise 3.5.17, apoc 3.5.0.9, gds 1.1.0
//or: Neo4j Enterprise 4.0.3, apoc 4.0.0.6 (NOT later! a bug in apoc.coll.max/apoc.coll.min needs to be resolved)
//contact tracing data import
//full spreadsheet with synthetic data
//https://docs.google.com/spreadsheets/d/1R-XVuynPsOWcXSderLpq3DacZdk10PZ8v6FiYGTncIE/edit#gid=0
// person sheet˝
// https://docs.google.com/spreadsheets/u/0/d/1R-XVuynPsOWcXSderLpq3DacZdk10PZ8v6FiYGTncIE/export?format=csv&id=1R-XVuynPsOWcXSderLpq3DacZdk10PZ8v6FiYGTncIE&gid=0
@ciiqr
ciiqr / dispatch.sh
Last active February 19, 2025 12:25
github actions, repository_dispatch with client_payload
# TODO: replace :token, :user, and :repo
curl -H "Authorization: token :token" \
-H 'Accept: application/vnd.github.everest-preview+json' \
"https://api.github.com/repos/:user/:repo/dispatches" \
-d '{"event_type": "awesomeness", "client_payload": {"foo": "bar"}}'
@mattstibbs
mattstibbs / put_colon_in_offset.py
Created August 17, 2019 16:00
Add a colon to timezone offset when using datetime.strftime
import datetime
original_timestamp = datetime.datetime.now()
# Convert datetime object to a string representation
timestamp_string = original_timestamp.strftime("%Y-%m-%dT%H:%M:%S%z")
print(timestamp_string)
# OUTPUT: 2019-08-17T00:00:00+0000
# Add a colon separator to the offset segment
@viniru
viniru / Unimodal.java
Created May 28, 2018 09:10
You are a given a unimodal array of n distinct elements, meaning that its entries are in increasing order up until its maximum element, after which its elements are in decreasing order. Give an algorithm to compute the maximum element that runs in O(log n) time
public class Unimodal {
public static void unimodal(int a[],int l,int h)
{
int mid = (l+h)/2;
if(a[mid] < a[mid+1])
{
if(a[mid+1] > a[mid+2])
{
System.out.println("The max element is : "+a[mid+1]);
@Attila03
Attila03 / FK.py
Created February 19, 2018 05:37
Django bulk insert with Foreign Key
from stocks import wsgi
from django.core.exceptions import ObjectDoesNotExist
from api.models import Stock, Company
import csv
csvpath = r'prices.csv'
batch_size = 500
t1 = time.time()
@nuhil
nuhil / js.md
Last active July 1, 2024 20:45
Javascript Handbook
@entrptaher
entrptaher / array_splice.js
Last active July 17, 2017 06:08 — forked from arsho/array_splice.js
Array splice implementation to convert an existing array to target array
(() => {
/**
* Fill gaps of an array
* @param {Object} sourceArray - The source array to compare to
* @param {Object} targetArray - The target array to fill the gap
* @param {string} Filler - The element to be used to fill the gap
*/
let similarFill = ((sourceArray, targetArray, filler) => {
let pos = 0;
for (let i = 0; i < targetArray.length; i++) {
@ratulbasak
ratulbasak / sqlite_bck.py
Created July 12, 2017 07:01
sqlite3 database backup to s3 in a specific bucket
import datetime
import os
import string
import tarfile
import shutil
import boto # you need to install "boto" == 'sudo pip install boto'
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from datetime import timedelta