Skip to content

Instantly share code, notes, and snippets.

View tsmgeek's full-sized avatar

Ricardo tsmgeek

  • London
View GitHub Profile
@malteo
malteo / LocalStorageProvider.js
Created December 12, 2011 17:04
localStorage state provider for ExtJS 3
Ext.ns('Ext.ux.state');
/**
* @class Ext.ux.state.LocalStorageProvider
* @extends Ext.state.Provider
* A Provider implementation which saves and retrieves state via the HTML5 localStorage object.
* If the browser does not support local storage, an exception will be thrown upon instantiating
* this class.
* <br />Usage:
<pre><code>
@kylemclaren
kylemclaren / findLongRunningOp.js
Last active September 24, 2024 12:05 — forked from comerford/killLongRunningOps.js
Find and (safely) kill long running MongoDB ops
db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5) printjson(op);
}
)
@komeda-shinji
komeda-shinji / gist:d2cfa8008b02cd4d0468
Last active February 23, 2016 10:05
Mailman: disable X-BeenThere, disable Cc when full personalize, disable notification if bounce_you_are_disabled_warnings_interval ==0
diff -u Mailman/Queue/CommandRunner.py- Mailman/Queue/CommandRunner.py
--- Mailman/Queue/CommandRunner.py- 2015-04-03 22:03:27.000000000 +0900
+++ Mailman/Queue/CommandRunner.py 2015-04-22 19:28:34.221206025 +0900
@@ -244,6 +244,9 @@
syslog('vette', 'replied and discard')
# w/discard
return False
+ if hasattr(mlist, 'ignore_requests') and mlist.ignore_requests:
+ syslog('vette', 'ignore and discard')
+ return False
@CMCDragonkai
CMCDragonkai / flock_timeout.php
Last active March 3, 2022 21:24
PHP: Simulating Lock Timeout with PHP's Flock
<?php
/**
* Acquires a lock using flock, provide it a file stream, the
* lock type, a timeout in microseconds, and a sleep_by in microseconds.
* PHP's flock does not currently have a timeout or queuing mechanism.
* So we have to hack a optimistic method of continuously sleeping
* and retrying to acquire the lock until we reach a timeout.
* Doing this in microseconds is a good idea, as seconds are too
* granular and can allow a new thread to cheat the queue.
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active November 16, 2024 03:47
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
#!/bin/bash
# based on https://github.com/victorcoder/dkron/issues/212
#dkron_url="http://localhost:8080"
dkron_url=$1
if [ -z "$dkron_url" ]; then
echo "Usage: $0 <dkron base url>"
exit 1
fi
curl -s -X GET "$dkron_url/v1/jobs" -H "accept: application/json" -o -
echo