Skip to content

Instantly share code, notes, and snippets.

@jarodium
jarodium / Surreal.php
Created March 19, 2023 00:45 — forked from EDDYMENS/Surreal.php
Surreal DB PHP SDK
<?php
/**
* Surreal fluent query
*
* @author EDDYMENS
* @license MIT (or other licence)
*/
class Surreal
{
@jarodium
jarodium / history_navigation.js
Created November 2, 2022 09:35 — forked from serin113/history_navigation.js
A simple JavaScript that lets you use your browser's back/forward buttons for in-page navigation by adding custom 'next' and 'previous' events to the window object.
/*
* Lets you use your browser's back/forward buttons for in-page navigation by
* adding custom 'next' and 'previous' events to the window object.
*
* Copyright (c) 2011 Tobias Schneider <[email protected]>
* This script is freely distributable under the terms of the MIT license.
*
* Example:
*
* window.addEventListener('next', function(){
@jarodium
jarodium / sticky.js
Created April 26, 2022 16:02 — forked from javierarques/sticky.js
Sticky Sideabr With Vanilla Javascript. Detects scroll and set fixed the element. Live example: http://codepen.io/javiarques/pen/vKdgjR
// Sticky Nav Component
var Sticky = (function() {
'use strict';
var CSS_CLASS_ACTIVE = 'is-fixed';
var Sticky = {
element: null,
position: 0,
addEvents: function() {
@jarodium
jarodium / downloader.js
Created July 3, 2020 12:19 — forked from jhidalgo3/downloader.js
Use NodeJS to download files
var path = require('path');
var url = require('url');
var http = require('http');
var fs = require('fs');
var write_file;
//what global variable do we have?
var complete = false;
var content_length = 0;
var downloaded_bytes = 0;
@jarodium
jarodium / traveling-salesman.php
Created November 1, 2018 10:00 — forked from tlhunter/traveling-salesman.php
PHP Traveling Salesman Genetic Algorithm
<?php
ini_set("error_reporting", E_ALL & ~E_NOTICE);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Genetic Algorithm : TSP : PHP Implementation by Thomas Hunter</title>
<style>
body {
@jarodium
jarodium / swipe.js
Created October 23, 2017 13:10
Updated version of swipe.js from Blake Simpson's Blog. This version supports miltitouch
$.fn.swipe = function( callback ) {
var touchDown = false,
originalPosition = null,
$el = $( this );
function swipeInfo( event ) {
if ('undefined' !== typeof event.originalEvent.pageX) {
var x = event.originalEvent.pageX,
y = event.originalEvent.pageY,
dx, dy;
@jarodium
jarodium / gist:1fe78f25a1fd6cbb83b57aaa264a65b5
Created April 20, 2017 22:23 — forked from sandrinodimattia/gist:3162314
Dynamics CRM 2011 eID Javascript
<html>
<head>
<title>eID: Read</title>
<script type="text/javascript" src="https://localhost:100/be_belgium_eid.js"></script>
<script language="javascript" type="text/javascript">
// Initialize the reader.
var cardReader = new be.belgium.eid.CardReader();
// Bind error events.
function noCardPresentHandler() { window.alert("No card present!"); }