First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.
This file contains hidden or 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
/* Trivial keyboard input layout to english switcher by Alexander V. Zhouravlev. | |
* Compile it with gcc -framework Carbon -o SwitchToEnglish SwitchToEnglish.m */ | |
#import <Carbon/Carbon.h> | |
int main (int argc, const char *argv[]) | |
{ | |
TISInputSourceRef english = TISCopyInputSourceForLanguage(CFSTR("en-US")); | |
if (!english) | |
return 1; |
This file contains hidden or 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 ruby | |
require 'config/boot.rb' | |
require 'config/environment.rb' | |
# FIXME use real CSV writer | |
File.open 'words.csv', 'w' do |csv| | |
for model in [Country, City] do | |
model.all.each do |c| | |
synonyms = [] | |
synonyms << c.name_en unless c.name_en == c.name |
This file contains hidden or 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 parse(xml=pricer_xml) | |
flight_indexes = xml.xpath('//r:flightIndex').map do |flight_index| | |
flight_index.xpath('r:groupOfFlights').map do |group| | |
Segment.new( :flights => | |
group.xpath("r:flightDetails/r:flightInformation").map { |fi| | |
Flight.new( | |
:operating_carrier => fi.xpath("r:companyId/r:operatingCarrier").to_s, | |
:marketing_carrier => fi.xpath("r:companyId/r:marketingCarrier").to_s, | |
:departure => fi.xpath("r:location[1]/r:locationId").to_s, | |
:departure_term => fi.xpath("r:location[1]/r:terminal").to_s, |
This file contains hidden or 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
package LE; | |
use strict; | |
use integer; | |
use locale; | |
use CL; | |
use Conf; | |
############################################################################### | |
# helper variables and functions first |
This file contains hidden or 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
<tr class="<%= segment_counter == 0 ? 'ow' : 'rt' %>"> | |
<% if variant.common_carrier && variant.segments.length > 1 %> | |
<% if segment_counter == 0 %> | |
<td rowspan=<%= variant.segments.length %> class="extra g-middle"> | |
<p style="background:url(<%= segment.marketing_carrier.icon_url %>) no-repeat"><%= segment.marketing_carrier_name %> | |
<% end %> | |
<% else %> | |
<td class="extra"> | |
<p style="background:url(<%= segment.marketing_carrier.icon_url %>) no-repeat"><%= segment.marketing_carrier_name %> | |
<% end %> |
This file contains hidden or 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
%xsl:stylesheet{ "xmlns:r" => "http://xml.amadeus.com/FMPTBR_09_1_1A", :version => "1.0", "xmlns:xsl" => "http://www.w3.org/1999/XSL/Transform" } | |
%xsl:output( indent="yes" )/ | |
%xsl:template( match="/" ) | |
%flights | |
%xsl:apply-templates( select="//r:flightInformation" )/ | |
%xsl:template( match="r:flightInformation" ) | |
%flight | |
%operating_carrier_iata | |
%xsl:value-of( select="r:companyId/r:operatingCarrier" )/ | |
%marketing_carrier_iata |
This file contains hidden or 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
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:r="http://xml.amadeus.com/FMPTBR_09_1_1A" | |
exclude-result-prefixes="r" | |
> | |
<xsl:output indent="yes" /> | |
<xsl:template match="text()" /> | |
<!-- возвращает неконформный xml документ - несколько roots. "лес" --> |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
require 'active_support' | |
require 'active_support/core_ext/string/multibyte' | |
require 'traviata/active_record_ext'#почему то из инициалайзера не подключается, вылезает undefined method `has_cases_for' | |
require 'every' | |
require 'russian' | |
$KCODE = 'u' | |
class Completer | |
attr_reader :updated_at |
This file contains hidden or 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" encoding="UTF-8"?> | |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> | |
<soap:Header xmlns="http://webservices.amadeus.com/definitions"> | |
<SessionId>00CIZ26MWK|3</SessionId> | |
</soap:Header> | |
<soap:Body> | |
<Fare_PricePNRWithBookingClassReply xmlns="http://xml.amadeus.com/TPCBRR_07_3_1A"> | |
<applicationError> | |
<applicationErrorInfo> | |
<applicationErrorDetail> |