This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Needs showlinennum in ~/bin folder of user, change it to some more general | |
# solution if you have showlinenum in path | |
if [ "$1" == "" ];then | |
rev="HEAD" | |
else | |
rev="$1" | |
fi | |
if [ -e ~/bin/showlinenum.awk ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Delayed | |
module Backend | |
module ActiveRecord | |
class Job | |
def mass_assignment_authorizer_with_logging | |
mass_assignment_authorizer_without_logging + [:logging_args] | |
end | |
alias_method_chain :mass_assignment_authorizer, :logging | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SendController < ActionController::Base | |
def send | |
# Important - browser can react differently for different types | |
self.response.headers["Content-Type"] ||= 'application/zip' | |
# Dispose that file has to be saved not displayed, also specify filename | |
self.response.headers["Content-Disposition"] = "attachment; filename=@filename" | |
self.response.headers['Cache-Control'] = 'no-cache' # do not try to cache file | |
http = Net::HTTP.new('server.dot.net', 80) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show_console | |
page.driver.console_messages.each do |line| | |
if [:source, :line_number].all?{|x| line.keys.include?(x)} | |
puts "#{line[:source]}:#{line[:line_number]} - #{line[:message]}" | |
else | |
puts "#{line[:message]}" | |
end | |
end | |
nil | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- old | |
+++ fixed | |
@@ -54,13 +54,13 @@ | |
#A bug was introduced in Sublime Text 3, sometime before 3053, in that it | |
#changes the active group to 0 when the layout is changed. Annoying. | |
active_group = window.active_group() | |
- window.set_layout(layout) | |
+ window.run_command('set_layout', layout) | |
num_groups = len(layout['cells']) | |
window.focus_group(min(active_group, num_groups-1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
def plugin_loaded(): | |
for window in sublime.windows(): | |
if window.num_groups() > 1: | |
window.set_minimap_visible(False) | |
class CloseMinimapOnMultiView(sublime_plugin.EventListener): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
set -o pipefail | |
plugin_repo_url="http://updates.jenkins-ci.org/download/plugins" | |
plugin_dir="/var/lib/jenkins/plugins" | |
include_optionals=false | |
showUsage() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import win32file | |
def read260(path): | |
handle = None | |
try: | |
# http://docs.activestate.com/activepython/2.6/pywin32/win32file__CreateFileW_meth.html | |
# http://timgolden.me.uk/pywin32-docs/win32file__CreateFileW_meth.html | |
handle = win32file.CreateFileW( | |
path, | |
win32file.GENERIC_READ, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import win32file | |
def write260(path, content): | |
handle = None | |
try: | |
# http://docs.activestate.com/activepython/2.6/pywin32/win32file__CreateFileW_meth.html | |
# http://timgolden.me.uk/pywin32-docs/win32file__CreateFileW_meth.html | |
handle = win32file.CreateFileW( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jenkins.* | |
import jenkins.model.* | |
import hudson.* | |
import hudson.model.* | |
import org.apache.commons.io.IOUtils | |
def jenkinsCredentials = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
com.cloudbees.plugins.credentials.Credentials.class, | |
Jenkins.instance, | |
null, | |
null |
OlderNewer