Skip to content

Instantly share code, notes, and snippets.

View pcakhilnadh's full-sized avatar
🎯
Focusing on Dreams

Akhil Nadh PC pcakhilnadh

🎯
Focusing on Dreams
View GitHub Profile
<?php
// obligatoire
session_start();
require('config/config.inc.php');
require('vendor/autoload.php'); // load des fichiers Facebook
use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper;
BITS = ('0', '1')
ASCII_BITS = 8
def bit_list_to_string(b):
"""converts list of {0, 1}* to string"""
return ''.join([BITS[e] for e in b])
def seq_to_bits(seq):
return [0 if b == '0' else 1 for b in seq]
@pcakhilnadh
pcakhilnadh / README.md
Created December 27, 2019 04:11 — forked from hofmannsven/README.md
Git Cheatsheet
@pcakhilnadh
pcakhilnadh / log.py
Created January 8, 2020 12:14
To find the total working hours you have worked for the day and week. This will also tell you how long you will have to work in a day before you can leave your office. Ofcourse, we all need some time to spend with our family and friends.
from datetime import datetime
import sys
def HHandMM_splitter(time):
timeHH,timeMM= time.split(':')
timeMM=timeMM[:-2]
if time[-2:]=='PM':
timeHH=str(12+int(timeHH))
return timeHH,timeMM
def timeDiff(timeObj1,timeObj2):
@pcakhilnadh
pcakhilnadh / installdeb.bash
Created January 29, 2020 10:19
Installing deb file in Linux
sudo dpkg -i /path/to/deb/file
sudo apt-get install -f
@pcakhilnadh
pcakhilnadh / sample_async_programming.py
Last active April 21, 2021 20:15
Asynchronous Programming Sample code snippet
import asyncio
import time
global var
var=0
def expensive_process():
return 1
@pcakhilnadh
pcakhilnadh / MergeTwoApiCallObservables.ts
Last active June 17, 2021 19:08
Merge two API Call response object into a third observable collection. Explanation :- I have two observables as shown below Observable <Array<Model1>> Observable <Array<Model2>> Model1 { id , first_name, last_name} Model 2{ id , class } What is the best way to convert it to observable 3 as shown below? where id in observable 1 and observable 2 …
/*
Summary
Merge two API Call response object into a third observable collection
Explanation
I have two observables as shown below
Observable <Array<Model1>>
Observable <Array<Model2>>