Skip to content

Instantly share code, notes, and snippets.

View Yogendra0Sharma's full-sized avatar
🎯
Focusing

Yogendra Sharma Yogendra0Sharma

🎯
Focusing
View GitHub Profile
@Yogendra0Sharma
Yogendra0Sharma / Angular.md
Created January 12, 2017 11:47 — forked from miro-jelaska/Angular.md
Learning notes

#▶Dave Smith - Deep Dive into Custom Directives - NG-Conf 2014 ★★★ ##When to use directives?

  • If you want a reusable HTML component
<my-widget>
  • If you want reusable HTML behavior
<div ng-click="...">
  • If you want to wrap a jQuery plugin
<div ui-date>

*Almost any time you need to interface with the DOM

@Yogendra0Sharma
Yogendra0Sharma / 00-ionic-notes.md
Created January 12, 2017 11:51 — forked from dwayne/00-ionic-notes.md
My notes on the Ionic Framework.
@Yogendra0Sharma
Yogendra0Sharma / README.md
Created January 12, 2017 11:51 — forked from hofmannsven/README.md
Notes on working with Laravel 5
@Yogendra0Sharma
Yogendra0Sharma / 01-intro.md
Created January 12, 2017 11:54 — forked from dwayne/01-intro.md
My notes from the book "ng-book: The Complete Book on AngularJS by Ari Lerner".

Introduction

Author: Ari Lerner.

AngularJS offers a single framework that can be used to build dynamic, client-centric applications. It provides:

  • Module support
  • DOM manipulation
  • Animations
  • Templating
@Yogendra0Sharma
Yogendra0Sharma / gist:999f795e15e6ba6b525ec3a919aac250
Created January 12, 2017 12:01 — forked from gladson/gist:1541450
sql to django queryset cheatsheet by pythonnewbie
Sql QuerySet Notes
SELECT count(*) FROM fruit Fruits.objects.count() table count
SELECT count(*) FROM fruit WHERE name=’Orange’ Fruits.objects.filter(name__exact=’Orange’).count() count with filter
SELECT * FROM fruit WHERE color is NULL Fruits.objects.get(color__isnull=True) filter by null
SELECT * FROM fruit WHERE color is NOT NULL Fruits.objects.get(color__isnull=False) filter by null
SELECT * FROM fruit WHERE name=’Apple’ Fruits.objects.get(name__exact=’Apple’) case sensitive
SELECT * FROM fruit WHERE lower(name)=lower(‘Apple’) Fruits.objects.get(name__iexact=’Apple’) case in-sensitive
SELECT * FROM fruit WHERE name LIKE ‘App%’ Fruits.objects.filter(name__startswith=’App’) case sensitive LIKE
SELECT * FROM fruit WHERE upper(name) LIKE ‘APP%’ Fruits.objects.filter(name__ista
@Yogendra0Sharma
Yogendra0Sharma / aggregate_tags.py
Created January 12, 2017 12:02 — forked from martync/aggregate_tags.py
Django aggregation in template filters.
from django import template
from django.db.models import Sum, Avg, Max, Min, Count
register = template.Library()
@register.filter
def sum(queryset, field):
return queryset.aggregate(sum_value=Sum(field)).get('sum_value')
@Yogendra0Sharma
Yogendra0Sharma / admin.py
Created January 12, 2017 12:03 — forked from gladson/admin.py
Admin actions: Activated and Deactivated => https://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/
class NameAnyModelAdmin(admin.ModelAdmin):
fields = ('field1', ('field2', 'field_checkbox'),)
list_display = ('field1', 'field2', 'field_checkbox',)
search_fields = ('field1',)
actions = ['field_checkbox_action']
def field_checkbox_action(self, request, queryset):
for obj in queryset:
if obj.field_checkbox == False:
@Yogendra0Sharma
Yogendra0Sharma / django-notes.rst
Created January 12, 2017 12:04 — forked from tomleo/django-notes.rst
Notes about the Django Framework

Django ORM

pet_set is a lazy object that only makes a call to the dtabase when you begin to iterate over it. When the queryset is evaluated it will caches the results so latter calls to pet_set will not also call the database.

pet_set = Pet.objects.filter(species="Dog")
@Yogendra0Sharma
Yogendra0Sharma / django-helper.txt
Created January 12, 2017 12:05 — forked from SivaCse/django-helper.txt
Django Development time helper notes
kill port already defined
=========================
fuser -k 8000/tcp
Kill annd Restart whenever u added new apps
---------------------------------------------
Create and activate virtual environment