Skip to content

Instantly share code, notes, and snippets.

View brijrajsingh's full-sized avatar

Brijraj Singh brijrajsingh

View GitHub Profile
@brijrajsingh
brijrajsingh / README.markdown
Created October 21, 2012 13:42 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@brijrajsingh
brijrajsingh / PackageCategory.php
Created October 10, 2013 09:40
a php script to look at the android play store for the given package name, and find out its category.
<?php
class PackageCategory
{
protected static $playurl = 'https://play.google.com/store/apps/details?id=';
public function PackageCategory($packageName) {
$this->packageName = $packageName;
}
@brijrajsingh
brijrajsingh / create_gitprojects.py
Last active December 27, 2015 13:09
Create project at gitlab along with giving access to developers, QAs and Artists, this python script creates 5 copies of a project and gives access to diff groups as need be, feel free to temper it to your need. I am new to python so I wrote it quite monolithic style. Developer list is separated by colon, and so does Artist and QA list, the file…
#Company - The perfect future technologies pvt. ltd.
#website - www.theperfectfuture.com
#Author - brijraj singh
#email - brijraj.singh@theperfectfuture.com
#Date - 06/11/2013
import urllib2,urllib
import sys,traceback
import csv
@brijrajsingh
brijrajsingh / ADFCountQuery.txt
Created October 14, 2019 10:52
ADF Counts Query
ADFActivityRun
| project Output, PipelineRunId,Status,OperationName
| where PipelineRunId == "YourPipelineRunId"and Status == "Succeeded"and OperationName startswith"Copy"
| extend dataRead_ = todouble(parse_json(Output).dataRead), filesWritten_ = todouble(parse_json(Output).filesWritten)
| summarize TotalDataReadGB=sum(dataRead_)/1000/1000/1000, TotalFilesWrittenInMils=sum(filesWritten_)/1000000
@brijrajsingh
brijrajsingh / adf-results.csv
Last active October 14, 2019 10:57
ADF Bulk Copy Results
Run Data Size(In Gb) No. of files Time Taken Partitions
1 160 6.8 Million 243 minutes None
2 160 6.8 million 92 minutes 2 (Date Partition)
3 465 27.4 million 110 minutes 23 (Date Partition)
4 160 6.8 million 7 minutes 16 (Prefix)
@brijrajsingh
brijrajsingh / GOT
Last active July 19, 2020 08:40 — forked from shivswami/MahabharataV4.adoc
The example graph consists of characters in Game of Thrones (GOT) - Graph created by Brijraj Singh
= Mahabharata =
The example graph consists of characters in Game of Thrones (GOT)
Key nodes - Relations, Characters, their houses, status of (Dead, Captured or Hurt), Properties like Title and Prefix
The Data is pulled from multiple websites - http://towerofthehand.com, http://gameofthrones.wikia.com/wiki/Game_of_Thrones_Wiki
//console
[source,cypher]
----
@brijrajsingh
brijrajsingh / python-azure-blob-storage-download.py
Created May 27, 2017 07:56
Downloadin an Azure Storage Blob Container with complex path of folders and sub folders
from azure.storage.blob import BlockBlobService
from azure.storage.blob import PublicAccess
import os
#name of your storage account and the access key from Settings->AccessKeys->key1
block_blob_service = BlockBlobService(account_name='storageaccountname', account_key='AccountKey')
#name of the container
generator = block_blob_service.list_blobs('testcontainer')
@brijrajsingh
brijrajsingh / NotNullToDefault.sql
Created August 23, 2016 07:36
Convert all the NOT NULL Columns in a Mysql database to Default NULL
SELECT CONCAT_WS('.',TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME) col,CONCAT('alter table ',TABLE_NAME,' MODIFY COLUMN ', COLUMN_NAME,' ',DATA_TYPE,'(',CHARACTER_MAXIMUM_LENGTH,') NULL DEFAULT NULL') as script_col
FROM information_schema.COLUMNS
WHERE is_nullable=0
and length(COLUMN_DEFAULT) is NULL and
CHARACTER_MAXIMUM_LENGTH is not NULL and
table_schema = 'dbName'
Union
SELECT CONCAT_WS('.',TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME) col,CONCAT('alter table ',TABLE_NAME,' MODIFY COLUMN ', COLUMN_NAME,' ',DATA_TYPE,' NULL DEFAULT NULL') as script_col
FROM information_schema.COLUMNS
WHERE is_nullable=0