# Decide how to define a method at runtime
class C
end
C.class_eval do
define_method :my_method do
'a dynamic method'
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
0x636c48edbedd078cd9e196dc6c2154c7f82e73b0 |
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
package main | |
import "fmt" | |
func main() { | |
// Declare a variable of type int | |
var age int | |
// Get the user's age | |
fmt.Println("Enter your age:") |
I've some problem when setup project with:
- Rails 4.2.10
- Ruby 2.5.3
- Postgresql 13
My steps:
Install Homebrew
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
# https://www.geeksforgeeks.org/program-distance-two-points-earth/ | |
earthRadius = 6371 # km | |
d_lat = (origin[:lat] - destination[:lat]) / 180.0 * Math::PI | |
d_lng = (origin[:lng] - destination[:lng]) / 180.0 * Math::PI | |
sin_lat = Math.sin(d_lat / 2) | |
sin_lng = Math.sin(d_lng / 2) | |
rad_lat1 = origin[:lat] / 180.0 * Math::PI | |
rad_lat2 = destination[:lat] / 180.0 * Math::PI | |
a = (sin_lat * sin_lat) + (sin_lng * sin_lng) * Math.cos(rad_lat1) * Math.cos(rad_lat2) |
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
$url = "http://www.domain.com/demo.jpg"; | |
$curl = curl_init($url); | |
curl_setopt($curl, CURLOPT_NOBODY, true); | |
$result = curl_exec($curl); | |
if ($result !== false) | |
{ | |
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); | |
if ($statusCode == 404) | |
{ | |
echo "URL Not Exists" |
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
# Table Driver | |
# Id : Integer | |
# Name : String | |
# Vehicle Attributes : JSON | |
# Example: | |
# { | |
# id: 1, | |
# name: 'Driver Name', | |
# vehicle_attributes: { |
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
$('.container-fluid').find('form.mobile-price-area').parent().removeClass('col-lg-5').addClass('col-lg-12') | |
var __extends = (this && this.__extends) || (function() { | |
var a = Object.setPrototypeOf || ({ | |
__proto__: [] | |
}instanceof Array && function(e, c) { | |
e.__proto__ = c | |
} | |
) || function(f, c) { | |
for (var e in c) { | |
if (c.hasOwnProperty(e)) { |
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
RIFF6MTDFmtdp0100pginÄC†2Z,r.•@LIST˚INFOIppn | |
MN0195075Icpd2010ICOPû© 2010 Dalmatian Music and Universal Music Publishing MGB Limited | |
This arrangement © 2019 | |
All Rights Reserved. | |
[Based on "Canon in D" by Johann Pachelbel]IcarAIpmgNauman, TomISFTMusE 434.0ITCHLucas KoehlerItonC MajorIfsb270INAMBeautiful in WhiteIpag6Idif7ICRD2010Imet4:4Imtnq = 80Isnm(based on Pachelbel's Canon)ItiaCanon in DItooC MajorIcexFor sale worldwideIbpkUNIsan92540Ilcm2ISRC!Universal Music Publishing GroupIpptmnIpri31ImgpKusuma, RiyandiImgnKusuma, RiyandiImgn | |
Filan, ShaneIART | |
Filan, ShaneIARTPachelbel, JohannIlyr | |
Filan, ShaneIarrKusuma, RiyandiIpalPachelbel, JohannesIKEY westlifeIGNRSoloIinsPianoIforInstrumental SoloIstyWeddingIstySolo InstrumentalIstyPopIstyAdult ContemporaryIpdd2019-04-08T20:23:45ZIpopwww.musicnotes.comIdlrMusicnotesmfntj | |
#!#1 #C#S#CDoremiTimes-BoldTimes-ItalicHelveticaHelvetica-ObliqueHelvetica-BoldLISTÑmtdPmtdcwe<!≈†ÖôLÒd>NZ˜/Fµ≥<ÒÀ+¥N≈”ï˛mÖê^T,X:ƒ‰f™ZlT |
NewerOlder