Skip to content

Instantly share code, notes, and snippets.

View detournemint's full-sized avatar
📻
On Air

detournemint

📻
On Air
View GitHub Profile
echo "Pushing logs to cloudlog"
cd ~/Radio/adifpush/adifpush
dotnet run ~/.local/share/WSJT-X/wsjtx_log.adi
dotnet run ~/.local/share/JS8Call/js8call_log.adi
echo "Logs pushed!"
{
"window.zoomLevel": 1,
"files.autoSave": "afterDelay",
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
"editor.tabSize": 2,
"files.insertFinalNewline": true
}
@output = []
@container.start
# sleep 10 # If I put the sleep here, it gives me the output correctly but I don't want to use a sleep.
@container.streaming_logs(stdout: true) { |stream, chunk| @output << chunk }
puts @output
>> ["Cloning https://github.com/RailsApps/learn-rails.git\n"]
Expected Output:
~ docker logs 5be66680bea4
@detournemint
detournemint / gist:3909c8339529548b49d9
Created March 28, 2016 16:02
Example of agnostic relationship
class Opportunity < ActiveRecord::Base
has_many :notes
end
class Note < ActiveRecord::Base
end
On the opportunity model I want a way when the Note updates (the updated_at column changes) that a column on the opportunity (note_last_updated or similar) updates. Notes are used all over my app so i wanted to avoid having a specific after_update callback on the note model.
@detournemint
detournemint / keybase.md
Created February 10, 2016 17:45
Keybase Proof

Keybase proof

I hereby claim:

  • I am greggawatt on github.
  • I am greggawatt (https://keybase.io/greggawatt) on keybase.
  • I have a public key whose fingerprint is 2F04 A420 3C8C 9750 3B89 6AD4 A164 1C99 A275 4372

To claim this, I am signing this object:

var deleteAllGroupMembers = (function () {
var deleteAllGroupMembers = {};
// the facebook ids of the users that will not be removed.
// IMPORTANT: add your own facebook id here so that the script will not remove yourself!
var excludedFbIds = ['77000939']; // make sure each id is a string!
var usersToDeleteQueue = [];
var scriptEnabled = false;
var processing = false;
deleteAllGroupMembers.start = function() {
@detournemint
detournemint / gist:fbc75d110bc9948ab802
Created January 31, 2015 00:32
Ajax call to set a model attribute in coffeescript from ember.js
$.ajax
url: "http://10.0.0.75:8080/packages/" +model.get('id')+"/apk/analytics/selectors"
headers:
Authorization: 'Basic ' + Cookies.utils.readCookie('spch')
success: (response) ->
model.set("selectors", $.map response.selectors, (val) -> val['selector_type'])
error: () ->
console.log "error"
@detournemint
detournemint / index.js
Created October 3, 2014 16:55
Ajax Pagination using the Pagination from Will Paginate
$(document).ready(function() {
$('.datepicker').datepicker();
$(".tablesorter").tablesorter();
var submit = document.getElementById("submit-button");
submit.onclick = getCalendarAppointments;
$(".pagination").on("click", 'a', function(event){
event.preventDefault();
@detournemint
detournemint / gist:bd4c558bca1ecf9a7bbf
Last active August 29, 2015 14:02
Javascript Button Handling
:javascript
$('.disconnect').click(function(event){
event.preventDefault();
var url = event.currentTarget.href
var isGood = confirm("Are You Sure?")
if(isGood){
$.ajax({
type:"POST",
url: url,
success: function(){
<div id="steps">
<h1> Steps </h1>
<h3>Step 1:</h3><label>Title: <input type='text' name='steps[1][title]'></label><label>Summary:<textarea name='steps[1][summary]'></textarea></label>
<label>Step Image: <input type="file" name="recipe[recipe_image]" accept="image/*" /></label> #thisone doesn't work
</div>
<label>Step Image: <input type="file" name="recipe[recipe_image]" accept="image/*" /></label> # this one works