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 AnnonceController < .... | |
def index | |
get_ads(params) | |
end | |
def method_missing | |
category = request.uri.do-some-extracting-of-last-name (jagthunde, racehunde, etc) | |
get_ads({:category => category} + params) | |
render :action => 'index' |
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
douglas:~# vmstat 1 | |
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- | |
r b swpd free buff cache si so bi bo in cs us sy id wa | |
1 1 664 122084 300 2910664 0 0 0 2 1 1 3 1 76 21 | |
0 1 664 121532 300 2911028 0 0 476 10 85 302 1 0 35 65 | |
0 1 664 121192 300 2911408 0 0 320 0 42 118 0 0 51 49 | |
0 1 664 120196 300 2912456 0 0 1008 312 153 336 0 0 49 51 | |
0 1 664 119728 300 2912924 0 0 456 0 59 173 0 0 51 49 | |
0 1 664 119056 300 2913440 0 0 608 0 80 194 0 0 49 51 | |
0 1 664 117736 300 2914824 0 0 1384 9 176 395 0 0 50 50 |
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
Loading development environment (Rails 3.2.2) | |
1.8.7 :001 > require 'odf/spreadsheet' | |
=> true | |
1.8.7 :002 > ODF::Spreadsheet.file("my-spreadsheet.ods") do |spreadsheet| | |
1.8.7 :003 > spreadsheet.table 'My first table from Ruby' do |table| | |
1.8.7 :004 > table.row {|row| row.cell 'Hello, rODF world!' } | |
1.8.7 :005?> end | |
1.8.7 :006?> end | |
NoMethodError: undefined method `encode' for Builder::XChar:Module | |
from /home/carsten/.rvm/gems/ruby-1.8.7-p358@misstoro_partner/gems/rodf-0.2.1/lib/odf/span.rb:30:in `xml' |
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 | |
FILE1=/tmp/`basename $1` | |
FILE2=/tmp/`basename $2` | |
xmllint --c14n $1 > $FILE1 | |
xmllint --c14n $2 > $FILE2 | |
diff $FILE1 $FILE2 |
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 AppState < ActiveRecord::Base | |
attr_accessible :key, :value | |
validates :key, presence: true | |
serialize :value | |
def self.get_value(key, default_value = nil) | |
as = AppState.find_by_key(key) | |
return default_value if as.blank? |
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
public class BackgroundWorker | |
{ | |
private Mutex mutex = new Mutex(true, "some-unique-id"); | |
public void Run() | |
{ | |
bool handleAquired = false; | |
try | |
{ |
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
var s1 = "" | |
+ "<OTA_HotelAvailNotifRQ MessageContentCode=\"1\" >" | |
+ "<AvailStatusMessages HotelCode=\"60737\">" | |
+ "<AvailStatusMessage BookingThreshold=\"-10\">"; | |
var s = @"<OTA_HotelAvailNotifRQ MessageContentCode=""1"" > | |
<AvailStatusMessages HotelCode=""60737""> | |
<AvailStatusMessage BookingThreshold=""-10""> | |
"; |
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
public class SqlQueue : IQueue | |
{ | |
private SqlConnection _connection; | |
public SqlQueue(SqlConnection connection) | |
{ | |
if (connection == null) throw new ArgumentNullException("connection"); | |
_connection = connection; | |
} |
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
# Remove Windows 11 crapware | |
winget uninstall "Cortana" --silent --accept-source-agreements | |
winget uninstall "Disney+" --silent --accept-source-agreements | |
winget uninstall "Mail and Calendar" --silent --accept-source-agreements | |
winget uninstall "Microsoft News" --silent --accept-source-agreements | |
winget uninstall "Microsoft OneDrive" --silent --accept-source-agreements | |
winget uninstall "Microsoft Tips" --silent --accept-source-agreements | |
winget uninstall "MSN Weather" --silent --accept-source-agreements | |
winget uninstall "Movies & TV" --silent --accept-source-agreements | |
winget uninstall "Office" --silent --accept-source-agreements |
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
public record CreateOrder(Guid CorrelationId) : CorrelatedBy<Guid>; | |
public record ProcessOrder(Guid OrderId, Guid ProcessingId); | |
public record OrderProcessed(Guid OrderId, Guid ProcessingId); | |
public record OrderCancelled(Guid OrderId, string Reason); | |
public class ProcessOrderConsumer : IConsumer<ProcessOrder> | |
{ |
OlderNewer