Skip to content

Instantly share code, notes, and snippets.

😃
Enjoying work at Moneybloom & in home. Programming is there as my best friend.

Rishikesh Agrawani hygull

😃
Enjoying work at Moneybloom & in home. Programming is there as my best friend.
Block or report user

Report or block hygull

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hygull
hygull / Python Tuple Lists with language codes (as of ISO 639-1) and country codes (as of ISO 3166).md
Created Dec 31, 2017
Python Tuple Lists with language codes (as of ISO 639-1) and country codes (as of ISO 3166)
View Python Tuple Lists with language codes (as of ISO 639-1) and country codes (as of ISO 3166).md
languages = [
    ('aa', 'Afar'),
    ('ab', 'Abkhazian'),
    ('af', 'Afrikaans'),
    ('ak', 'Akan'),
    ('sq', 'Albanian'),
    ('am', 'Amharic'),
    ('ar', 'Arabic'),
    ('an', 'Aragonese'),
@hygull
hygull / LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143.md
Last active Mar 27, 2020
LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143
View LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143.md

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

@hygull
hygull / Conversion of a simple Month Year string to short form.md
Last active Mar 22, 2020
Conversion of a simple Month Year string to short form
View Conversion of a simple Month Year string to short form.md

An Illustration

> function getDateShortName(s, shortYear=true) {
...     let parts = s.split(/\s+/ig)
...     
...     if(shortYear) {
.....         return parts[0].slice(0, 3) + '\'' + parts[1].slice(2)
.....     } else {
.....         return parts[0].slice(0, 3) + '\'' + parts[1]
@hygull
hygull / adding_2_numbers.ts
Created Apr 12, 2017
TypeScript - Adding 2 numbers (integers, floats)
View adding_2_numbers.ts
/*
{
"created_at" : "11 April 2017 (before 02:05 am)",
"aim_of_script" : "To add 2 numbers",
"coded_by" : "Rishikesh Agrawani",
}
*/
function addition(num1:number, num2:number)
{
@hygull
hygull / regex-list-dict-based-python-q-for-beginners.md
Last active Nov 23, 2019
Regex list dict based Python question for beginners
View regex-list-dict-based-python-q-for-beginners.md
@hygull
hygull / pattern-based-python-q-for-beginners.md
Last active Nov 23, 2019
Pattern based Python question for beginners
View Cabs-Service-Project-Doc.md

Cab Service Based Project Doc

Objective

  • To book vehicle to visit places near by Bangalore.

    • People can book vehicles without any registration by using their mobile numbers.

    • In first page, they can enter place details as follows:

View json-parse.md

Just to understand where exactly you have to do the modification and what little mistake you did has already been pointed out in the above comments.

> var arr = [ "{\"id\": \"amzn\", \"price\": 1785.6600341796875, \"_attachments\": \"attachments/\"}", "{\"id\": \"msft\", \"price\": 138.42999267578125, \"_attachments\": \"attachments/\"}", "{\"id\": \"googl\", \"price\": 1244.280029296875, \"_attachments\": \"attachments/\"}", "{\"id\": \"ba\", \"price\": 331.05999755859375, \"_attachments\": \"attachments/\"}", "{\"id\": \"air.pa\", \"price\": 122, \"_attachments\": \"attachments/\"}" ]
undefined
> 
> item0 = arr[0]
'{"id": "amzn", "price": 1785.6600341796875, "_attachments": "attachments/"}'
> 
> item0Obj = JSON.parse(item0)
{ id: 'amzn', price: 1785.6600341796875, _attachments: 'attachments/' }
@hygull
hygull / Matrix multiplication in Golang(2 matrices of order 3x3).go
Last active Sep 30, 2019
Matrix multiplication in Golang(2 matrices of order 3x3) created by hygull - https://repl.it/Et8I/2
View Matrix multiplication in Golang(2 matrices of order 3x3).go
/*
{
"date_of_creation" => "19 Dec 2016, Mon",
"aim_of_program" => "Matrix multiplication in Golang",
"coded_by" => "Rishikesh Agrawani",
"Go_version" => "1.7",
}
*/
package main
@hygull
hygull / setattr-stkovrflw.md
Last active Sep 23, 2019
Use of setattr() function to set attributes of class object
View setattr-stkovrflw.md

setattr()

Check my answer at https://stackoverflow.com/a/58067032/6615163

>>> class TEST:
...     def __init__(self, project = 'ABC', scenarios = {'A': [1,2,3], 'B': [4,5,6]}):
...         self.project = project
...         for feature in scenarios:
You can’t perform that action at this time.