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
SELECT TOP ( 10 ) | |
dbname = DB_NAME( qt.dbid ) | |
, qt.objectid | |
, qs.execution_count | |
, query_text = SUBSTRING( | |
qt.text, qs.statement_start_offset / 2 + 1 | |
, ( CASE | |
WHEN qs.statement_end_offset = -1 THEN LEN( CONVERT( nvarchar(MAX), qt.text )) * 2 | |
ELSE qs.statement_end_offset | |
END - qs.statement_start_offset ) / 2 ) |
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
Get Ubuntu with NGINX | |
sudo apt update | |
sudo apt upgrade | |
# install Docker | |
# https://docs.docker.com/engine/install/ubuntu/ | |
git clone https://github.com/getsentry/self-hosted.git --branch 22.4.0 <tag> | |
cd self-hosted | |
./install.sh |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strconv" | |
"strings" | |
) |
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
DECLARE @name NVARCHAR(256) -- database name | |
DECLARE @path NVARCHAR(512) -- path for backup files | |
DECLARE @fileName NVARCHAR(512) -- filename for backup | |
DECLARE @fileDate NVARCHAR(40) -- used for file name | |
-- specify database backup directory | |
SET @path = 'C:\test\' | |
-- specify filename format | |
SELECT @fileDate = REPLACE(REPLACE(REPLACE(CONVERT(NVARCHAR(20),GETDATE(),120), '-', ''), ' ', ''), ':', '') |
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 'dart:io'; | |
import 'package:dio/dio.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:path_provider/path_provider.dart'; | |
class DownloadFileScreen extends StatefulWidget { | |
@override | |
_DownloadFileScreenState createState() => _DownloadFileScreenState(); | |
} |
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 'package:flutter/material.dart'; | |
class ChatConversationScreen extends StatefulWidget { | |
@override | |
_ChatConversationScreenState createState() => _ChatConversationScreenState(); | |
} | |
class _ChatConversationScreenState extends State<ChatConversationScreen> { | |
var currentAudioIndex = -1; //The index of the currently playing audio. By default it is -1 |
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 function takes two sets of values, say Coordinates and returns the angle bearing to the location. | |
//a1 and a2 being latitude and longitude of location a | |
//b1 and b2 being latitude and longitude of location b | |
double bearing(double a1, double a2, double b1, double b2) { | |
const double TWOPI = 6.2831853071795865; | |
const double RAD2DEG = 57.2957795130823209; | |
// if (a1 = b1 and a2 = b2) throw an error | |
//double theta = atan2(b1 - a1, a2 - b2); | |
double theta = math.atan2(b1 - a1, a2 - b2); | |
if (theta < 0.0) |
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
--Step 1: (create a new user) | |
CREATE LOGIN hello WITH PASSWORD='foo', CHECK_POLICY = OFF; | |
-- Step 2:(deny view to any database) | |
USE master; | |
GO | |
DENY VIEW ANY DATABASE TO hello; | |
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 React, { Component } from 'react'; | |
import { View, Image } from 'react-native'; | |
import { Container, Content, Footer, Body, Text } from 'native-base'; | |
import { StackActions, NavigationActions } from 'react-navigation'; | |
export default class extends Component { | |
constructor(props){ | |
super(props); | |
this.state = { | |
timer: 5 //The duration you want it to stay in seconds |
NewerOlder