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
require 'shellwords' | |
class FixAttachmentContentType | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
if form_hash = env["rack.request.form_hash"] | |
fix_tempfiles(form_hash) |
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
#!/bin/sh | |
sudo route delete default | |
sudo route add default gw 192.168.0.199 | |
ruby ~/script/gwwin_login.rb username password |
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
@echo off | |
pause | |
net stop "wuauserv" | |
echo importing setup-wsus.reg | |
%windir%\regedit.exe /s setup-wsus.reg | |
echo setup-wsus.reg imported succesfully | |
net start "wuauserv" | |
echo forcing update detection | |
wuauclt /detectnow | |
pause |
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
#!/bin/sh | |
set -e | |
pkg=vim | |
mandir=/usr/share/man | |
bindir=/usr/local/bin | |
priority=30 | |
update-alternatives --install /usr/bin/vim vim $bindir/vim $priority | |
update-alternatives --install /usr/bin/vimdiff vimdiff $bindir/vim $priority |
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 feedback(object) | |
setup_mail(object) | |
@body[:object] = object | |
@subject = truncate(object.title, :lenght => 64) | |
unless object.attachments.empty? | |
content_type "multipart/mixed" | |
part :content_type => "text/plain", :body => render_message("feedback", @body) | |
object.attachments.each do |item| |
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
require 'rubygems' | |
require 'irb/ext/save-history' | |
IRB.conf[:SAVE_HISTORY] = 100000 | |
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history" | |
require 'irb/completion' | |
require 'hirb' | |
# Hirb::View.enable | |
def change_log(stream) | |
ActiveRecord::Base.logger = Logger.new(stream) |
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
These files describes how to configure automatic google sitemap | |
generation. | |
1. In your models you should define class method which will be generate | |
array or urls with last modified timestamp. | |
2. In 'lib/tasks/google_sitemap.rb' you should update 'sources' and | |
'host' variables for your site. | |
3. You should configure cron tasks to periodically regenerate sitemap | |
and ping google. You could use nice gem whenever and sample schedule | |
in 'config/schedule.rb' |
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
<?xml version="1.0"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match target="font" > | |
<edit mode="assign" name="rgba" > | |
<const>rgb</const> | |
</edit> | |
</match> | |
<match target="font" > | |
<edit mode="assign" name="hinting" > |
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
# set up the databases | |
rake "db:create", :env => 'development' | |
rake "db:create", :env => 'test' | |
# install required gems | |
gem "haml" | |
run "haml --rails ." | |
# run nifty generators | |
generate :nifty_layout, "--haml" |
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
./guile_filter_doc_snarfage --filter-snarfage) > regex-posix.doc || { rm regex-posix.doc; false; } | |
cat alist.doc arbiters.doc array-handle.doc array-map.doc arrays.doc async.doc backtrace.doc boolean.doc bitvectors.doc bytevectors.doc chars.doc control.doc continuations.doc debug.doc deprecated.doc deprecation.doc discouraged.doc dynl.doc dynwind.doc eq.doc error.doc eval.doc evalext.doc expand.doc extensions.doc feature.doc fluids.doc foreign.doc fports.doc gc-malloc.doc gc.doc gettext.doc generalized-arrays.doc generalized-vectors.doc goops.doc gsubr.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc init.doc ioext.doc keywords.doc list.doc load.doc macros.doc mallocs.doc memoize.doc modules.doc numbers.doc objprop.doc options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc promises.doc properties.doc r6rs-ports.doc random.doc rdelim.doc read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc srfi-13.doc srfi-14.doc srfi-4.doc stackchk.doc stacks.doc stime.d |