Skip to content

Instantly share code, notes, and snippets.

View rally25rs's full-sized avatar

Jeff Valore rally25rs

View GitHub Profile
@rally25rs
rally25rs / gist:cb58c6aa57a04d777efb
Created September 23, 2014 18:46
SQL Server - Get all running queries
SELECT SUBSTRING(st.text, ( r.statement_start_offset / 2 ) + 1,
( ( CASE WHEN r.statement_end_offset <= 0
THEN DATALENGTH(st.text)
ELSE r.statement_end_offset END -
r.statement_start_offset ) / 2 ) + 1) AS statement_text ,
r.session_id,
r.status,
r.command,
r.cpu_time,
r.total_elapsed_time
@rally25rs
rally25rs / fileStorage.coffee
Created December 29, 2014 14:22
Cordova File API Wrapper
window.fileStorage =
save: (name, data) ->
deferred = $.Deferred()
fail = (error) =>
deferred.reject(error)
gotFileSystem = (fileSystem) =>
fileSystem.root.getFile(name, { create: true, exclusive: false }, gotFileEntry, fail)
@rally25rs
rally25rs / nginx_rails_sendfile.md
Last active July 7, 2023 09:17
nginx rails send_file madness

Goal: Have some static content, served by Nginx, but it requires an authenticated user. User auth is through Rails.

Project structure: The actual static files are in /home/vagrant/docs/ The browser will use the URL /help/* to access this content

The Ruby bits: RAILS_ENV=production rails server is used to start a WEBrick on port 3000.

config/environments/production.rb

@rally25rs
rally25rs / data.json
Created April 29, 2019 17:53
search sample data
[
"V004D000000007826042019160212558 Asap ABC Sales Sales 33019 1556312412 1 NORMAL Platform Toolkit API",
"V004E000000007926042019160212584 Asap ABC Sales Sales 33019 1556312472 1 NORMAL Platform Toolkit API",
"V004F000000008026042019160212609 Asap ABC Sales Sales 33019 1556312532 1 NORMAL Platform Toolkit API",
"V0050000000008126042019160212634 Asap ABC Sales Sales 33019 1556312532 1 NORMAL Platform Toolkit API",
"V0051000000008226042019160212659 Asap ABC Sales Sales 33019 1556312592 1 NORMAL Platform Toolkit API",
"V0052000000008326042019160212685 Asap ABC Sales Sales 33019 1556312652 1 NORMAL Platform Toolkit API",
"V0053000000008426042019160212711 Asap ABC Sales Sales 33019 1556312712 1 NORMAL Platform Toolkit API",
"V0054000000008526042019160212737 Asap ABC Sales Sales 33019 1556312712 1 NORMAL Platform Toolkit API",
"V0055000000008626042019160212761 Asap ABC Sales Sales 33019 1556312772 1 NORMAL Platform Toolkit API",
@rally25rs
rally25rs / m503_m122.txt
Created February 6, 2020 11:10
Printer settings dump
Send: M503
Recv: echo: G21 ; Units in mm (mm)
Recv:
Recv: echo:Filament settings: Disabled
Recv: echo: M200 D1.75
Recv: echo: M200 D0
Recv: echo:Steps per unit:
Recv: echo: M92 X93.00 Y93.00 Z137.00 E104.00
Recv: echo:Maximum feedrates (units/s):
Recv: echo: M203 X300.00 Y300.00 Z5.00 E25.00