This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Directive, Attribute} from '@angular/core'; | |
| import {NgModel} from '@angular/common'; | |
| @Directive({ | |
| selector: '[mask]', | |
| host: { | |
| '(keyup)': 'onInputChange()' | |
| } | |
| }) | |
| export class Mask { | |
| maskPattern: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay | |
| "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop | |
| "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext | |
| "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config.json | |
| reading-image.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This shows how to use Object.create */ | |
| /** BASE MODEL **********************************/ | |
| function BaseModel(collection) { | |
| this.collection = collection; | |
| } | |
| BaseModel.prototype.getCollection = function() { | |
| return this.collection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| module.exports = function CustomError(message, extra) { | |
| Error.captureStackTrace(this, this.constructor); | |
| this.name = this.constructor.name; | |
| this.message = message; | |
| this.extra = extra; | |
| }; | |
| require('util').inherits(module.exports, Error); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var app = require('express')(); | |
| var GridStore = require('mongodb').GridStore; | |
| var ObjectID = require('mongodb').ObjectID; | |
| var MongoClient = require('mongodb').MongoClient; | |
| var Server = require('mongodb').Server; | |
| var dbConnection; | |
| MongoClient.connect("mongodb://localhost:27017/ersatz?auto_reconnect", {journal: true}, function(err, db) { | |
| dbConnection = db; | |
| app.listen(3000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.db import models | |
| class Categoria(models.Model): | |
| nome = models.CharField(max_length=200) | |
| slug = models.SlugField(unique=True, blank=True, null=True) | |
| parent = models.ForeignKey('self', blank=True, null=True, related_name='child') | |
| class Produto(models.Model): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django import forms | |
| from django.contrib import admin | |
| from .models import Categoria | |
| class CategoriaForm(forms.ModelForm): | |
| class Meta: | |
| model = Categoria | |
| fields = '__all__' | |
| def __init__(self, *args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django import forms | |
| from django.contrib import admin | |
| from .models import Categoria | |
| class CategoriaForm(forms.ModelForm): | |
| class Meta: | |
| model = Categoria | |
| fields = '__all__' | |
| def __init__(self, *args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django import forms | |
| from .models import Categoria | |
| class CategoriaForm(forms.ModelForm): | |
| class Meta: | |
| model = Categoria | |
| fields = '__all__' |