Skip to content

Instantly share code, notes, and snippets.

View anuj9196's full-sized avatar
🎯
Focusing

Anuj Sharma anuj9196

🎯
Focusing
View GitHub Profile
@anuj9196
anuj9196 / script.js
Created January 29, 2021 05:08
script.js
$(document).ready((e) => {
$('#footer').text('Hello world');
});
@anuj9196
anuj9196 / countdown.js
Last active August 9, 2019 05:52
Display a countdown timer
// 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();
@anuj9196
anuj9196 / order.json
Created July 4, 2019 17:11
Order payload
{
"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
{
"serviceList": [
{
"technicianId": 23,
"serviceId": 11
},
{
"technicianId": 23,
"serviceId": 9
}
{
"serviceList": [
{
"technician": {
"firstName": "Anuj",
"id": 23,
"lastName": "Sharma",
"nickName": "sdsd",
"salonsId": 1,
"usersId": 1
@anuj9196
anuj9196 / r.json
Created June 18, 2019 02:55
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 March 15, 2019 09:36
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
@anuj9196
anuj9196 / serializer.py
Created August 14, 2018 17:20
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
@anuj9196
anuj9196 / rest.py
Created August 14, 2018 17:09
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 August 9, 2018 05:32
Check music duration and create music loop in 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