Skip to content

Instantly share code, notes, and snippets.

-- Declare a temporary table to store the counts
CREATE TABLE #RowCounts (
TableName NVARCHAR(256),
RowCount1 INT
);
-- Declare variables
DECLARE @TableName NVARCHAR(256);
@andrijac
andrijac / vaperwave.js
Created May 17, 2023 16:23
Vaperware chars
let unicodeString = "";
for(let i = 0xFF21; i <= 0xFF3A; i++) {
unicodeString += String.fromCharCode(i); // uppercase A-Z
}
for(let i = 0xFF41; i <= 0xFF5A; i++) {
unicodeString += String.fromCharCode(i); // lowercase a-z
}
@andrijac
andrijac / find_by_string.sql
Created September 26, 2022 16:50
Search all database tabels by string
--https://stackoverflow.com/questions/9185871/how-do-i-search-an-sql-server-database-for-a-string
CREATE PROCEDURE FindByString
@DataToFind NVARCHAR(4000),
@ExactMatch BIT = 0
AS
SET NOCOUNT ON
DECLARE @Temp TABLE(RowId INT IDENTITY(1,1), SchemaName sysname, TableName sysname, ColumnName SysName, DataType VARCHAR(100), DataFound BIT)
INSERT INTO @Temp(TableName,SchemaName, ColumnName, DataType)
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace Utility
{
public class AesSymmetricCrypter
{
public string Decrypt(string key, string cipherText)
Future main() async {
var server = await HttpServer.bind(
InternetAddress.loopbackIPv4,
4040,
);
print('Listening on localhost:${server.port}');
await for (HttpRequest request in server) {
request.response.write('Hello, world!');
await request.response.close();
@andrijac
andrijac / Service.dart
Created October 6, 2020 15:11
Dart unit test and mocking with GetX
import 'package:get/get.dart';
import 'extService.dart';
class Service1 {
static Service1 get to => Get.find<Service1>();
int counter = 1;
int getCounter() {
@andrijac
andrijac / bitcoin_spv_wallet_overview.md
Created September 17, 2020 09:29 — forked from TOMOAKI12345/bitcoin_spv_wallet_overview.md
Bitcoin SPV Wallet Flow Overview

var sum = function(x, y) {
let scale = 100;
return ((x*scale)+(y*scale))/scale;
}
sum(0.1, 0.2)
// => 0.3
//OR
parseFloat((0.1+0.2).toFixed(2))
(function(obj){
let arr = [];
for(w in obj) {
arr.push({
'name': w,
'type': getType(obj[w])
});
}
console.dir(arr);
@andrijac
andrijac / deconstruct.js
Created December 4, 2019 10:39
From book "How JavaScript Works"
function deconstruct(number){
let sign = 1;
let coefficient = number;
let exponent = 0;
// Remove sign from the coefficient
if(coefficient < 0){
coefficient = -coefficient;
sign = -1;
}