Skip to content

Instantly share code, notes, and snippets.

View shimondoodkin's full-sized avatar

Shimon Doodkin shimondoodkin

View GitHub Profile
@shimondoodkin
shimondoodkin / app.js
Last active May 7, 2024 13:34 — forked from katanacrimson/app.js
nodejs app - expressjs 3.0 + socket.io v9 + passport + redis (made to work)
var express = require('express'),
passport = require('passport'),
GoogleStrategy = require('passport-google').Strategy,
connect = require('express/node_modules/connect'),
http = require('http'),
path = require('path'),
util = require('util'),
fs = require('fs'),
redis = require('redis'),
cookie = require('cookie'),
@shimondoodkin
shimondoodkin / php_tiny_curl.php
Last active May 6, 2024 10:51
php tiny curl - a curl function with method, data, headers, cookies, simple to use.
function encodeURIComponent($str) {
$revert = array('%21'=>'!', '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')');
return strtr(rawurlencode($str), $revert);
}
class curl_onHeaders
{
@shimondoodkin
shimondoodkin / app.js
Created July 14, 2012 15:47
node.js express integrated with socket io, also with mysql and basic auth.
/**
* Module dependencies.
*/
var io = require('socket.io')
, sio, sio_client_on
, express = require('express')
, MemoryStore = express.session.MemoryStore
, routes = require('./routes')
, sessionStore = new MemoryStore();
@shimondoodkin
shimondoodkin / expirering-blocklist-waiting-queue.js
Last active February 5, 2024 15:58
this queue lets run not related tasks in parallel,
type Task = () => Promise<void> | void;
export class TTLCache {
cache: Map<string, number> = new Map();
set(key: string, ttl: number): void {
const expiresAt = Date.now() + ttl * 1000; // Convert TTL to milliseconds
this.cache.set(key, expiresAt);
it is a copy of a header from one of the files.
tell me what you thing about the plan.
the framework is complete about 20%
//
//
// how it works?
// server
// \----\
// | app skeleton // creates an app object
@shimondoodkin
shimondoodkin / tinyxhr.js
Last active September 19, 2023 18:10
tiny xhr snippet to do XMLHttpRequest
// tinyxhr by Shimon Doodkin - licanse: public doamin - https://gist.github.com/4706967
//
// tinyxhr("http://site.com/ajaxaction",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data) });
// tinyxhr("http://site.com/ajaxaction",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data) },'POST','value1=1&value2=2');
// tinyxhr("http://site.com/ajaxaction.json",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data); console.log(JSON.parse(data)) },'POST',JSON.stringify({value:1}),'application/javascript');
// cb - a callback function like: function (err,data,XMLHttpRequestObject){ if (err) throw err; }
//
function tinyxhr(url,cb,method,post,contenttype)
{

The following is result of interaction with chat.bing.com

input: GSK-3 inhibitor and dyrk1a inhibitor , is there common or similar functionality?

Searching for: GSK-3 inhibitor and dyrk1a inhibitor

Searching for: GSK-3 inhibitor and dyrk1a inhibitor common or similar functionality

Generating answers for you…

//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@shimondoodkin
shimondoodkin / cron.js
Created February 27, 2012 20:18
javascript cron can be used in node.js
/*
Added complex matches by Shimon Doodkin 2012
Developed by Elijah Rutschman 2009 - http://elijahr.blogspot.com/2009/03/javascript-cron.html
*/
/*
a typical cron entry has either wildcards (*) or an integer:
.---------------- minute (0 - 59)
| .-------------- hour (0 - 23)
| | .------------ day of month (1 - 31)
@shimondoodkin
shimondoodkin / http.vbs
Last active March 23, 2023 04:51
excel vba xmlhttp with cookies, asynchronous, and with proxy support
' asynchronious http and synchronius http
' depends on Timer module
' ADD a referece to "Microsoft WinHTTP Services, version 5.1" (in Tools-> References)
Private Const CP_UTF8 = 65001
Private Declare Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long, ByVal lpMultiByteStr As Long, ByVal cchMultiByte As Long, ByVal lpDefaultChar As Long, ByVal lpUsedDefaultChar As Long) As Long
' http jobs example - async http
'Public Sub testasync_steps(Optional userarg As Variant = "", Optional step As Variant = 0, Optional data As String = "", Optional cookie As String = "", Optional haderror As Boolean = False)