Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Anuj Sharma anuj9196

💭
I may be slow to respond.
Block or report user

Report or block anuj9196

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
@anuj9196
anuj9196 / countdown.js
Last active Aug 9, 2019
Display a countdown timer
View countdown.js
// Set the date we're counting down to
var obj = document.getElementById("tbe-countdown");
var date = obj.getAttribute("data-date");
if (!date || date == "") {
console.error("Date should be of formate: Mon d, YYYY HH:mm:ss");
}
var countDownDate = new Date(date).getTime();
View order.json
{
"serviceList": [
{
"technician": {
"firstName": "sadfasf",
"id": 33,
"lastName": "asfasf",
"nickName": "hgjhj",
"phoneNo": "0235253465",
"photo": "\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAABgCAYAAADVenpJAAAEfklEQVR4Xu2dwWsTQRjFv4m1LepZ8OZJURGUekmCgnjyUFBkSwVR10L/AVEUvSpWwXsPNongod2q4KknQSQbFdGLqOjBm+hJEKogTUZSUGpam2z2zexM8nrNzPu+fe+Xb5JmSVQhKGnhX986oAhA32a/fOEEoL/zJwAG828erW+1lqe5nPqQE/1pSfTPtPWUVgtpNVbu5wRAuinqZX1w4Mjze6e+Q2VXiKGPbAIASKohjfBZNFEGSLWVIABtLbK5QF2No7PXbFYkADbd/k8tLbJYi8ItWbRCALJw/d+as3EUjmfVBgHIyvnlN825S/HcmaksWyAAGbmvlFypzoXXMyr/tywByCABLfKgFoUnMii9qiQBsJ/CjzgKN9svu3ZFAmA5iTgKleWS65YjABbT0CK3alF40WLJtqUIQFuLcAtce/Y3r4wA4PJdV0mLXK5F4Q1L5TouQwA6tirdQhef/ZwA6TJNsvtjHIU7kmywtZYTwIbTuQ1749nTb2yUSlqDACR1rIv1ro5/HgFdhNnNFhsAHAxmdjeU2i4NGU7So1ZyP8n6dmt5Q0iLQ0rkSzUKt7UzrrvHtSoElRci+kB3+/G7CMBqABaqUXgUbfXI6PSmoeHBRbRuWj0C0Oqglpl4PpxIa2zrfvSLN1R/BKB1Ahj42DcflB4pkVFUaEgdArDazfNxFN5Gmuzqs795jQTAMACunv1/LpsAGAageLK8Ry9pJ/+pxAmw9pyHHgH
View order_detail_short.json
{
"serviceList": [
{
"technicianId": 23,
"serviceId": 11
},
{
"technicianId": 23,
"serviceId": 9
}
View order_detail.json
{
"serviceList": [
{
"technician": {
"firstName": "Anuj",
"id": 23,
"lastName": "Sharma",
"nickName": "sdsd",
"salonsId": 1,
"usersId": 1
View r.json
servicesDummy = [
{
id: 1,
serviceName: 'menicure',
subservices: [
{ id: 1, subserviceName: 'deluxe menicure', price: 45 },
{ id: 2, subserviceName: 'jelly menicure', price: 55 },
{ id: 3, subserviceName: 'classic menicure', price: 85 },
]
},
@anuj9196
anuj9196 / Graph of git log in terminal
Created Mar 15, 2019
Graph of git log in terminal
View Graph of git log in terminal
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative master..development
View serializer.py
class ContactSerializer(serializers.HyperlinkedModelSerializer):
phone_numbers = ContactPhoneNumberSerializer(
source='contactphonenumber_set',
many=True,
required=False
)
emails = ContactEmailSerializer(
source='contactemail_set',
many=True,
required=False
View rest.py
class ContactViewSet(viewsets.ModelViewSet):
"""
This viewset automatically provides `list`, `create`, `retrieve`,
`update` and `destroy` actions.
Additionally we also provide an extra `favourite`action
"""
serializer_class = ContactSerializer
permission_classes = (IsAuthenticated, AdminAuthenticationPermission,)
@anuj9196
anuj9196 / check_music_duration_and_create_music_loop.php
Created Aug 9, 2018
Check music duration and create music loop in PHP
View check_music_duration_and_create_music_loop.php
/**
* prepare music loop
*
* requires: james-heinrich/getid3 package
* install using composer:
* `composer require james-heinrich/getid3`
*
* @param $music_path, Local Music file absolute path
* @param $total_media_count, Number of Images/Videos to add in the video
* @param $each_media_delay, Delay duration for each Image/Video
@anuj9196
anuj9196 / anagram.py
Last active Aug 11, 2018
Program to count number of items to be deleted to make two strings anagrams.
View anagram.py
"""
Given two strings, a and b, that may or may not be of same length,
determine the minimum number of character deletions required to make a and b anagrams.
Any characters can be deleted from either of the strings
NOTE: Anagram of a word is formed by arranging the letters of the word.
For eg. -> for the word RAM: RAM, AMR, MAR, etc are the anagrams
"""
attempts = int(input())
You can’t perform that action at this time.