Skip to content

Instantly share code, notes, and snippets.

View rajatxs's full-sized avatar

Rajat Sharma rajatxs

View GitHub Profile
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@rajatxs
rajatxs / rpc.service.ts
Created April 30, 2023 17:30
Simple JSON-RPC utility for web
import { HttpService } from 'https://gist.github.com/rajatxs/c17ef2f25b3ab7e935654d69c7ee5d8c#file-http-service-ts'
export type RpcVersion = '1.0' | '2.0'
export interface RpcRequestPayload {
jsonrpc: RpcVersion
method: string
params: Array<any>
id: number
}
@rajatxs
rajatxs / http.service.ts
Last active April 1, 2023 16:16
Simple HTTP utility for web
export type HttpResponseType = 'text' | 'json' | 'blob'
export type HttpRequestMethods = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'
export type HttpRequestQueryParams = Record<string, number|string>
export type HttpHeaders = Record<string, string>
export interface HttpResponseEventDetail {
status: number
statusText: string
ok: boolean
body: any
}
pragma solidity ^0.4.19;
contract ERC20Basic {
string public constant name = "Blockseries Token";
string public constant symbol = "BST";
uint8 public constant decimals = 18;
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Transfer(address indexed from, address indexed to, uint tokens);
@rajatxs
rajatxs / test.sql
Created September 15, 2021 04:11
SQL test queries
CREATE DATABASE IF NOT EXISTS test;
USE test;
CREATE TABLE IF NOT EXISTS users(
id INT(3) PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(60) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
gender ENUM('MALE', 'FEMALE'),
profile_image TEXT,
@rajatxs
rajatxs / service-intro.html
Created August 8, 2021 07:52
Developar service intro page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="keywords" content="Developar" />
<meta name="description" content="Developar" />
<meta name="author" content="Developar Team" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@rajatxs
rajatxs / settings.json
Last active October 18, 2022 08:03
My VSCode Settings
{
"breadcrumbs.enabled": false,
"editor.minimap.enabled": false,
"diffEditor.ignoreTrimWhitespace": false,
"explorer.confirmDelete": false,
"window.menuBarVisibility": "compact",
"workbench.startupEditor": "newUntitledFile",
"explorer.confirmDragAndDrop": false,
"editor.fontFamily": "'Roboto Mono', Consolas, 'Courier New', monospace",
"editor.tabSize": 3,