Skip to content

Instantly share code, notes, and snippets.

View mustafamagdy's full-sized avatar
🦾
Keep coding ...

Mustafa Magdy mustafamagdy

🦾
Keep coding ...
View GitHub Profile
@c3founder
c3founder / Math-Multi-Language-OCR.js
Last active November 10, 2024 07:04
Math and Multi Language OCR for Roamresearch
// ==UserScript==
// @name Math and Multi Language OCR for Roamresearch
// @author Connected Cognition Crumbs <c3founder@gmail.com>
// @require Roam42: Wait until Roam42 loads completely
// @version 0.4
// @description Ctrl+click => Math OCR using Mathpix (need to register on mathpix.com and activate the API)
// Shift+click => First Language OCR with Tesseract
// Alt+click => Second Language OCR with Tesseract
// Alt+a c => Replace the image with the OCR result
// @match https://*.roamresearch.com
@ataube
ataube / transaction.js
Created August 14, 2016 20:25
Loopback async/await transaction example
const Transaction = require('loopback-datasource-juggler');
const update = async (ids, delta) => {
const result = [];
const tx = await models.MyModel.beginTransaction({ isolationLevel: Transaction.READ_COMMITTED });
try {
for (const id of ids) {
const entity = await updateById(id, delta, { transaction: tx });
result.push(entity);
}
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@millermedeiros
millermedeiros / build.js
Created May 9, 2012 01:15
sample node.js build script including RequireJS optimizer (r.js) and copy/delete/filter files
// Combine JS and CSS files
// ---
//
// Make sure you install the npm dependencies
// > cd YOUR_PROJECT_FOLDER
// > npm install
//
// Than run:
// > node build
@shiawuen
shiawuen / index.html
Created December 29, 2011 15:05
Sample to upload file by chunk
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>test upload by chunk</title>
</head>
<body>
<input type="file" id="f" />
<script src="script.js"></script>