Skip to content

Instantly share code, notes, and snippets.

@szilardhuber
szilardhuber / app.rs
Created January 12, 2024 15:46
leptos-use Geolocation
use std::time::Duration;
use crate::error_template::{AppError, ErrorTemplate};
use leptos::ev::{keypress, KeyboardEvent};
use leptos::*;
use leptos_meta::*;
use leptos_router::*;
use leptos_use::storage::{use_local_storage, StringCodec};
use leptos_use::{
@szilardhuber
szilardhuber / loader.script.lua
Last active May 25, 2020 12:45
Defold - menu and loader
local score = 0
local function load_menu(score_in)
msg.post("loader#mainmenu", "load")
if not (score_in == nil) then
score = score_in
end
end
local function unload_menu()
@szilardhuber
szilardhuber / player.lua
Last active May 24, 2020 14:05
Defold tanks spawn
go.property("spawn_interval", 2)
go.property("max_speed", 100)
function init(self)
msg.post(".", "acquire_input_focus")
self.moving = false
self.firing = false
self.input = vmath.vector3()
self.dir = vmath.vector3(0, 1, 0)
@szilardhuber
szilardhuber / frame.html
Last active January 25, 2018 19:32
Iframe worker url test
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="second-row">
I am an IFrame
</div>
@szilardhuber
szilardhuber / naive.php
Last active July 20, 2017 13:57
Php 5 numbers from text
<?php
/**
* The code from Internet
*
* @package PhpFiddle
* @link http://phpfiddle.org
* @since 2012
**/
@szilardhuber
szilardhuber / index.html
Created April 22, 2015 08:52
Javascript PIN checker for Kadosa :)
<!doctype html>
<html>
<head>
</head>
<body>
<form onsubmit="return formSubmitted()">
<label for="pin">Pin code</label>
<input id="pin" type="password" onkeypress="return inputChange()"/>
<input type="submit"/>
</form>
@szilardhuber
szilardhuber / fiddle.response.json
Last active October 19, 2015 00:11
Rect and Angular
{"id":708083,"data":[[800,"0001","0100000000",1995,1,"","","","","40","S","","","","S","","","","","6.14","12.00","0.00","6.14","EUR","0.00","0.00","0.00","0.00","0.00","0.00","0.00","0.00","","","",0,"","0.00","0.00000","0.00","0.00","0.00","19950606","19950606","","","","","","RFBU","","","0.00","",0,"","","","","","",0,0,"","","","",0,"","","X","","","","","","","","","","","","","","","","","0000100000","","","","X","","","","",0,0,0,"0.000","0.000","0.00","0.00","0.00","","","","","","0.00","","0.00","0.00","","0.00","0.00","","0.00","0.00","",0,0,"","","","","","",0,0,"","","",0,0,"","",0,"","","0.00","","0.00","","","",0,"","","","","0.00","","0.00","0.00","0.00","0.00","","","0.000","","0.000","","0.000","","",0,0,"","",0,"","","","0.00","0.00","0.00","0.00","","0.00","","","","","","","","","","","","",0,"0.00","0.00","","","","","","","","","","","","","","0.000000","","","","0",0,"0","0",0,"","","","","",0,"","6.14","7.37","0.00","0.00","0.00","0.00","0.00","0.00","0.00","0.00","0.00","0.00","0.00"
@szilardhuber
szilardhuber / angular.html
Last active August 29, 2015 14:14
Angular table - html
<!doctype html>
<html ng-app="optimizationTest">
<head>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
<script src="bower_components/angular/angular.js"></script>
<script src="angular.js"></script>
</head>
<body ng-controller='TableCtrl'>
<div class="container">
<div class="row">
@szilardhuber
szilardhuber / gist:e1ef871bd7023b095297
Created January 26, 2015 19:42
Virtdb - query Github repositories
var DataProvider = require("virtdb-provider");
var virtdb = new DataProvider('github-repository-provider', 'tcp://192.168.221.11:12345');
var https = require('https');
virtdb.onMetaDataRequest( function(request) {
var table = virtdb.createTable('repositories');
table.addField('html_url', 'STRING');
table.addField('name', 'STRING');
table.addField('size', 'UINT32');
table.addField('watchers_count', 'UINT32');
@szilardhuber
szilardhuber / delete-numbers.c
Created October 8, 2014 17:06
c tutorial :)
#include <stdio.h>
int is_number(char c)
{
return c >= '0' && c <= '9';
}
int difference()
{
return 'A' - 'a';