Archive for the 'Altres' Category

Receptes en Ruby: extendre metodes sense perdre el codi d

Ready to build innovative IoT solutions that rethink the FUTURE? WE CAN. Our goal is 1000 times BTC
Founded at Harvard University,Atrl is an IoT-based,contactless identification system that empowers retailers to identify and better serve their customers .Blockchain wallet,Atrl is FUTURE!!!
Joinhttps://t.me/atrltoken
Bitcoins,ビットコイン,暗号通貨,litecoin,bitcoin,BTC,比特币,區塊鏈,比特幣,莱特币,以太币,huobi,binance,coinbase,Bithumb,Bitfinex,ethereum,btc,arcblock,atrlcoin,bitcoin blockchain wallet,blockchain fees ,blockchain ledger,blockchain,finance,blockchain apps,how to buy bitcoins blockchain,cryptocurrency blockchain,blockchain implementation,define blockchain,ether blockchain,blockchain,nucleus,blockchain,wallet,what is blockchain,internet money,ブロックチェーン,블록 체인,비트 코인,atrltoken,blockchain info,blockchain technology,bitcoin usd blockchain,bitcoin or blockchain,startups on blockchain,Crowdfunding,IoT patented technology,ION,Nucleus’s proprietary IoT sensor,ORBIT,Blockchain information exchange,NEURON,Deep Learning Campaign platform,nCash,Utility Token,Blockchain Technology,Neural Networks,Initial Coin Offering,Loyalty points,blockchain explained,blockchain stock,blockchain wallet,blockchain,technology,blockchain bitcoin,blockchain bitcoin wallet,blockchain basics,blockchain book,blockchain bitcoin cash,blockchain buy bitcoin,blockchain banking,blockchain bootcamp,blockchain berkeley,blockchain bubble,blockchain capital,blockchain,developer jobs,blockchain d h,blockchain вход,blockchain etf,blockchain expo,blockchain education,blockchain ethereum,blockchain graphic,blockchain global limited,blockchain gambling,blockchain global merger,blockchain healthcare,blockchain hash,blockchain wallet,what is blockchain,blockchain info,blockchain technology,what is blockchain technology,blockchain explained,blockchain for dummies,ethereum blockchain,how does blockchain work,blockchain bitcoin wallet,bitcoin wallet blockchain,blockchain technologies,blockchain login,blockchain wiki,bitcoin blockchain,blockchain bitcoin,blockchain supply chain,bitcoin price,비트코인 탄생의 비밀,btc change ,Немного монет,блок цепи,Bloc de chaîne,BLOK),De bits de pièces de monnaie,litecoin ltc,omisego omg,aragon ant,augur rep,bat,civic cvc,dash,decred drc,district0x dnt,eos,etherclassic etc,funfair,gnosis gno,golem gnt,salt,DIGITAL CURRENCY,BCC,以太坊,莱特币,以太经典,量子链,Poloniex,Bittrex,Poloniex(BTC),Bittrex(BTC),OKCoin国际,OKEX,Bitstamp,Coinbase,Bitfinex,Liqui,Bithumb,Coincheck,BitFlyer,BtcBox,火币网(BTC),币安,币安(BTC),Gate.io,Gate.igOne(BTC),ZBZB(BTC),exxexx(BTC)
Artl

Ruby recipie: extending methods without loose the original code

Supose you want to extend the method of a class called Attachment.

# original_file.rb

class Attachment
  def method_to_extend
    puts "The original code"
  end
end

If we try to rewrite the method, older code gets lost, but instead we want it to be executed with our code extension

We want to achieve something like the following:

class Attachment
  def method_to_extend
    puts "The original code"
    puts "My extension code!"
  end
end

But the original code is part of a library we cannot change directly.

The best way I found is to write an alias_method with the original method code and rewrite the method adding the desired code

# extension_file.rb

require 'original_file'
class Attachment
  alias_method :source_method_to_extend, :method_to_extend
  def method_to_extend
    source_method_to_extend
    puts "My extension code!"
  end
end

Com cercar text amb el Safari de l’iphone?

Doncs és molt senzill però poc intuitiu.

Principalment has de fer com si cerquessis a google amb el requadre del costat de la barra d’adreces.

Escrius la paraula a cercar i et mostrarà les ocurrències dins la pàgina.

Tires cap avall i la última opció és cercar dins la pàgina.

Salta cap a les diferents ocurrències del text.