Skip to content

Instantly share code, notes, and snippets.

View djurczak's full-sized avatar

Daniel Jurczak djurczak

  • Vienna, Austria
View GitHub Profile
@samesense
samesense / remote_to_local_clipboard.md
Last active May 15, 2019 11:32
Copy to local machiine clipboard from iteractive remote session

Copy to local machine clipboard from iteractive remote session

  • Works with macOS and remote linux machine
  • On local machine, make this plist file to use with launchclt
  • On local machine launchctl load local.pbcopy.9999.plist. This must remain running for remote copy to work.
  • On remote machine cat "message or file" | nc localhost 9997 -w1
  • nc is at /mnt/isilon/cbmi/variome/perry/bin/nc
  • On local machine, use paste or pbpaste as usual

Extra

  • On my locate machine, p is aliased to the launchctl command
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@pond
pond / gist:5eaec0c30c0b4477f234
Last active August 29, 2015 14:05
PostgreSQL "active?" Rails adapter check async patch
# This monkey patches the PostgreSQL adapter to use asynchronous
# communication when doing its "SELECT 1" check for is-connection-active.
# One symptom of this problem is stalled processing queues in Sidekiq.
# See also:
#
# https://github.com/rails/rails/issues/12867
#
# At the time of writing we have seen indefinite blocking down in the C
# library's "poll()" method due to the out-of-box Rails code using blocking
# I/O, in multithreaded environments - one thread gets stuck in the I/O and
@mutewinter
mutewinter / Alfred 3 Workflows.md
Last active November 25, 2020 14:14
A list of Alfred 3 workflows I'm using.
@postpostmodern
postpostmodern / rails_bootstrap_delete_confirmation_modal.md
Created February 19, 2012 07:38 — forked from trey/rails_bootstrap_delete_confirmation_modal.md
A nice delete confirmation modal in Rails courtesy of Bootstrap

Here's what you get.

Some CoffeeScript (verbosely commented for clarity)

# Override Rails handling of confirmation

$.rails.allowAction = (element) ->
  # The message is something like "Are you sure?"
  message = element.data('confirm')
@danielpietzsch
danielpietzsch / deploy.rb
Created March 10, 2011 22:50
Deploy a specific or the current Git branch by default using Capistrano
# parses out the current branch you're on. See: http://www.harukizaemon.com/2008/05/deploying-branches-with-capistrano.html
current_branch = `git branch`.match(/\* (\S+)\s/m)[1]
# use the branch specified as a param, then use the current branch. If all fails use master branch
set :branch, ENV['branch'] || current_branch || "master" # you can use the 'branch' parameter on deployment to specify the branch you wish to deploy