Skip to content

Instantly share code, notes, and snippets.

View purplecandy's full-sized avatar

Nadeem Siddique purplecandy

View GitHub Profile
@purplecandy
purplecandy / solution.py
Created January 28, 2020 13:51
LeetCode: Add Two Numbers
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
# traversing both nodes together and adding the last digit if carry is generated
pnode = result = ListNode(None)
@purplecandy
purplecandy / index.html
Last active May 10, 2019 15:35
Input test
<!-- Copyright 2015 the Dart project authors. All rights reserved.
Use of this source code is governed by a BSD-style license
that can be found in the LICENSE file. -->
<h2>Listening to input</h2>
<br>
<p>Enter text to echo:</p>
@purplecandy
purplecandy / tmdb.rb
Created April 24, 2019 11:37 — forked from rectifyer/tmdb.rb
Get images from TMDB
require 'httparty'
# TMDB
TMDB_API_KEY = '[your api key]'
# get configuration parameters
response = HTTParty.get("https://api.themoviedb.org/3/configuration?api_key=#{TMDB_API_KEY}")
config = JSON.parse(response.body)
image_prefix = config['images']['secure_base_url']
INSERT INTO students(id,name,age) VALUES (1,'Nadeem',19);
@purplecandy
purplecandy / create.sql
Created December 17, 2018 05:09
Learn SQL Create
CREATE TABLE students(
id INTEGER,
name TEXT,
age INTEGER
);
@purplecandy
purplecandy / syntax.sql
Last active December 17, 2018 05:00
Learn SQL syntax gist
CREATE TABLE tableName(
column_name data_type,
column_name data_type
);
<!DOCTYPE html>
<html>
<head>
<title>Tribute Page</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.12.4.js"></script>