Skip to content

Instantly share code, notes, and snippets.

@tkowalczyk
tkowalczyk / AirdropContract.sol
Created October 26, 2023 17:04
Simple smart contract for Airdrop Hunters by @TomKowalczyk
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.9;
contract AirdropContract {
function whatPurpose() public pure returns (string memory) {
return 'Simple smart contract for Airdrop Hunters by @tomkowalczyk';
}
}
import {
LCDClient,
MsgExecuteContract,
MnemonicKey,
isTxError
} from '@terra-money/terra.js';
import dotenv from 'dotenv';
dotenv.config();
@tkowalczyk
tkowalczyk / gist:79ccacad128f6395b3828cac166f7cbd
Created November 12, 2021 14:00
STARTERRA_PLAY2EARN_ORION
https://finder.terra.money/columbus-5/tx/B1ADBD5B48012A6EB19DF6EC200CA450E10827301FB57CDC543E4F9E20410A7A
https://finder.terra.money/columbus-5/tx/8FCBD1973319609C47A6BC0E0493AEFCFD9B127F80A3E1E661173C1731B68710
https://finder.terra.money/columbus-5/tx/C6F639EDF1DC43F5B89E48084CA368366B08D573BA8A3C1C901EE0B0E3F74451
https://finder.terra.money/columbus-5/tx/2BCB9BEA8F74B0692196F5438E346D5B1C11D4A2EDB5A7CE0B3029E46455A691
https://finder.terra.money/columbus-5/tx/2FD6785FB3B7831BC1B7EA59656D1AFBA71DAFE5D4BEEB0529EF8EDAD5F1EA4D
USE YourDatabase
GO
SELECT db.[name] AS [DatabaseName]
,id.[object_id] AS [ObjectID]
,OBJECT_NAME(id.[object_id], db.[database_id]) AS [ObjectName]
,id.[statement] AS [FullyQualifiedObjectName]
,id.[equality_columns] AS [EqualityColumns]
,id.[inequality_columns] AS [InEqualityColumns]
,id.[included_columns] AS [IncludedColumns]
function scroll(){ window.scrollTo(0,document.body.scrollHeight); console.log(document.body.scrollHeight); }; setInterval(scroll, 3000);
<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" class="highcharts-root" style="font-family:'lucida grande', 'lucida sans unicode', arial, helvetica, sans-serif;font-size:12px;" xmlns="http://www.w3.org/2000/svg" width="1200" viewBox="0 0 1200 800" height="800"><desc>Created with Highcharts 5.0.0</desc><defs><clipPath id="highcharts-9"><rect x="0" y="0" width="1145" height="676" fill="none"></rect></clipPath></defs><rect fill="#ffffff" class="highcharts-background" x="0" y="0" width="1200" height="800" rx="0" ry="0"></rect><rect fill="none" class="highcharts-plot-background" x="45" y="49" width="1145" height="676"></rect><g class="highcharts-grid highcharts-xaxis-grid "><path fill="none" class="highcharts-grid-line" d="M 104.5 49 L 104.5 725" opacity="1"></path><path fill="none" class="highcharts-grid-line" d="M 165.5 49 L 165.5 725" opacity="1"></path><path fill="none" class="highcharts-grid-line" d="M 225.5 49 L 225.5 725" opacity="1"></path><path fill="none" class="highcharts-grid-line" d="M 2
Digits and (), min 9 max 20
^[0-9()]{9,20}$
Phone number
@"^([+]{1}[0-9]{2})?([ -]{1})?[0-9]{3}([ -]{1})?[0-9]{3}([ -]{1})?[0-9]{3}$"
@tkowalczyk
tkowalczyk / euclidean_dist
Created March 25, 2015 12:59
#How to calculate Euclidean Distance in R?
#How to calculate Euclidean Distance in R?
print("How to calculate Euclidean Distance in R?")
fa <- c(5,2,1,4)
fb <- c(5,5,4,2)
fm <- matrix(c(fa,fb), byrow=T, nrow=2)
col_names_vectors <- c("U1", "U2", "U3", "U4")
row_names_vectors <- c("FilmA","FilmB")
@tkowalczyk
tkowalczyk / manhattan_dist
Last active January 7, 2019 07:46
How to calculate Manhattan Distance in R?
#How to calculate Manhattan Distance in R?
print("How to calculate Manhattan Distance in R?")
fa <- c(5,2,1,4)
fb <- c(5,5,4,2)
fm <- matrix(c(fa,fb), byrow=T, nrow=2)
col_names_vectors <- c("U1", "U2", "U3", "U4")
row_names_vectors <- c("FilmA","FilmB")
@tkowalczyk
tkowalczyk / Stick on one skeleton via ID
Created April 3, 2014 12:52
Stick on one skeleton via ID
int _trackedSkeletonId = 0;
Skeleton _currentSkeleton;
void sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
{
_currentSkeleton = null;
using (SkeletonFrame frame = e.OpenSkeletonFrame())
{
if (frame == null)