This file contains 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
{ | |
"Nest Cron": { | |
"prefix": "nestcron", | |
"body": "import { Injectable, Logger } from '@nestjs/common';\nimport { Cron } from '@nestjs/schedule';\n\n@Injectable()\nexport class ${1:Name}Service {\n\tprivate readonly logger = new Logger(${1:Name}Service.name);\n\n\t@Cron('45 * * * * *')\n\thandleCron() {\n\t\tconsole.log('Called when the current second is 45');\n\t}\n}", | |
"description": "Create new task class with cron method for NestJS" | |
}, | |
"Nest MongoDB Model": { | |
"prefix": "nestschema", | |
"body": "import { Prop, Schema, SchemaFactoryx} from '@nestjs/mongoose';\nimport { Document } from 'mongoose';\n\nexport type ${1:param}Document = ${1:param} & Document;\n@Schema({\n \t// timestamp: true\n})\nexport class ${1:param} {\n\t@Prop()\n\tpropName: string;\n\n\t// More props here\n}\n\nexport const ${1:param}Schema = SchemaFactory.createForClass(${1:param});\n", | |
"description": "Create new mongodb shcema for NestJS" |
This file contains 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 React from 'react'; | |
import { createContext } from 'react'; | |
import { useSocket } from '../hooks/useSocket' | |
export const SocketContext = createContext(); | |
export const SocketProvider = ({ children }) => { | |
const { socket, online } = useSocket('http://localhost:8080'); |
This file contains 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
function binarySearch(value, list) { | |
let first = 0; | |
let last = list.length - 1; | |
let position = -1; | |
let found = false; | |
let middle; | |
while (found === false && first <= last) { | |
middle = Math.floor((first + last)/2); | |
if (list[middle] == value) { |
This file contains 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowPublicReadAccess", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": [ | |
"s3:GetObject" | |
], |
This file contains 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 'dart:collection'; | |
import 'package:flutter/material.dart'; | |
class Item { | |
final String id; | |
String listId; | |
final String title; | |
Item({this.id, this.listId, this.title}); | |
} |
This file contains 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
const Alexa = require('ask-sdk') | |
const admin = require('firebase-admin') | |
var serviceAccount = require('./testing-iot-19f5e-firebase-adminsdk-oj631-6d9d70e282.json') | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount), | |
databaseURL: 'https://testing-iot-19f5e.firebaseio.com' | |
}) |
This file contains 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 'package:flutter/material.dart'; | |
void main() => runApp(App()); | |
class App extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Login Example', |
This file contains 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 'package:flutter/material.dart'; | |
import 'package:flutter/painting.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains 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
// Install the folowing plugins | |
// Flutter and Flutter Snippets | |
// Carbon or Polacode | |
// Waka Time for productivity track | |
// Turbo Console Log | |
// ES7 React/Redux/GraphQL/React-Native snippets | |
// Material Theme | |
// Numbered Bookmarks | |
// Error Lens | |
// Git Lens |