Skip to content

Instantly share code, notes, and snippets.

View dancrew32's full-sized avatar
🕶️
🕶

Dan Masquelier dancrew32

🕶️
🕶
View GitHub Profile
@dancrew32
dancrew32 / qcodes.txt
Created March 25, 2022 07:13
qcodes for ham radio
‘Q’ CODES
QAV Are you calling me ? ( I am calling . . . )
QRA What is your station ?
QRB How far away are you ?
QRG What channel am I on ?
QRH Does my frequency vary ?
QRI How is my tone ?
QRJ Are youy recieving me badly ? Are signals too weak ?
QRK What is my readability ? ( 1 to 5 ) 1 = unreadable. 5 = perfect.
QRL Are you busy ? ( I am busy, do not cut in. )
@dancrew32
dancrew32 / react_stripe_elements_mock.js
Created March 22, 2019 01:02
react-stripe-elements mock object so you can run the damn unit tests.
export const mockWindowStripe = () => {
window.Stripe = () => ({
createSource: jest.fn(),
elements: () => ({
create: () => ({
mount: jest.fn(),
update: jest.fn(),
destroy: jest.fn(),
on: jest.fn(),
}),
<?xml version="1.0"?>
<!----------------------------------------------------------------------------
A frontal cat face detector using the basic set of Haar features, i.e.
horizontal and vertical features but not diagonal features.
Contributed by Joseph Howse (josephhowse@nummist.com).
More information can be found in the following publications and
presentations:
@dancrew32
dancrew32 / tmobile-apn-mms-fix.md
Last active January 17, 2016 07:20
tmobile gsm blackberry classic q20 apn mms "general problems" solution

T-Mobile Blackberry Classic "General Problems" MMS solution

You're here because you're setting up a Blackberry on OS10 for T-Mobile and none of your MMS text messages are sending. Here is how you fix that. T-Mobile seems to only setup the APN for you by default, but they forget to configure the final step (2.6 below), which actually makes it work.

See flashfox's original answer.

Please leave a comment if you have something to add!

1. Mobile Network APN

@dancrew32
dancrew32 / distinct_keys.js
Created November 8, 2013 07:54
Mongo distinct keys map reduce
var collection = "your_collection"
var distinct_keys_map_reduce = db.runCommand({
"mapreduce" : collection,
"map" : function() {
for (var key in this) { emit(key, null); }
},
"reduce" : function(key, val) { return null; },
"out": collection + "_keys"
})
db[distinct_keys_map_reduce.keys].distinct("_id")
@dancrew32
dancrew32 / rdiopop.log
Last active December 23, 2015 10:09
rdio chrome popping noise log
loading.target.rdio: 81.574ms www.rdio.com/:27
loading.js: 687.297ms www.rdio.com/:27
[Wed Sep 18 2013 22:04:52 GMT-0700 (PDT)] [Services] Loader is ready core.rdio.a7d29e55813049a4dbf6f873a8816314.js:1
[Wed Sep 18 2013 22:04:52 GMT-0700 (PDT)] [Services] Storage is ready core.rdio.a7d29e55813049a4dbf6f873a8816314.js:1
[Wed Sep 18 2013 22:04:52 GMT-0700 (PDT)] [Services] ShortcutManager is ready core.rdio.a7d29e55813049a4dbf6f873a8816314.js:1
[Wed Sep 18 2013 22:04:52 GMT-0700 (PDT)] [Services] WebSocketFactory is ready core.rdio.a7d29e55813049a4dbf6f873a8816314.js:1
[Wed Sep 18 2013 22:04:52 GMT-0700 (PDT)] [FallbackWrapper] Embedding fallback swf core.rdio.a7d29e55813049a4dbf6f873a8816314.js:1
[Wed Sep 18 2013 22:04:52 GMT-0700 (PDT)] [Services] Notifications is ready core.rdio.a7d29e55813049a4dbf6f873a8816314.js:1
[Wed Sep 18 2013 22:04:52 GMT-0700 (PDT)] [Services] OfflineMonitor is ready core.rdio.a7d29e55813049a4dbf6f873a8816314.js:1
[Wed Sep 18 2013 22:04:52 GMT-0700 (PDT)] [Timer] loading.target.rdio:
@dancrew32
dancrew32 / uber.js
Created November 14, 2012 21:37
Uber.js, call an UberCab from command line.
#!/usr/local/bin/casperjs
/*
* Uber.js
* Call an UberCab from the command line
* Usage:
* update `email` and `pass` variables to match your uber.com account
* ./uber.js <my address>
*/
@dancrew32
dancrew32 / ermagherd.js
Created July 26, 2012 23:08
ermagherd translator for node.js
// to use in nodejs, just var erma = require('./ermagherd.js').ermagherd;
// erma.gherd('my string');
var erma = {
translate: function(word) {
// Don't translate short words
if (word.length == 1) {
return word;
}
@dancrew32
dancrew32 / trackpoint.sh
Created June 2, 2012 22:00
Make trackpoint scrolling work in ubuntu 11.04
#!/bin/sh
xinput list | sed -ne 's/^[^ ][^V].*id=\([0-9]*\).*/\1/p' | while read id
do
case `xinput list-props $id` in
*"Middle Button Emulation"*)
xinput set-int-prop $id "Evdev Wheel Emulation" 8 1
xinput set-int-prop $id "Evdev Wheel Emulation Button" 8 2
xinput set-int-prop $id "Evdev Wheel Emulation Timeout" 8 200
xinput set-int-prop $id "Evdev Wheel Emulation Axes" 8 6 7 4 5
xinput set-int-prop $id "Evdev Middle Button Emulation" 8 0
@dancrew32
dancrew32 / spotify.php
Created April 23, 2012 19:00
find and play a track by command line
#!/usr/bin/php
<? // just ./spotify.php
$api = array(
'context' => stream_context_create(array('http'=>array('method'=>'GET'))),
'ns' => 'spotify',
'url' => 'http://ws.spotify.com/search/1/track.json?q=',
);
fwrite(STDOUT, 'Pick a song: ');