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 'open-uri' | |
doc = Nokogiri::HTML(URI.open("https://www.oscars.org/oscars/ceremonies/2022")) | |
doc.css(".view-grouping-header h2") |
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
<?php | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "YOUR_INTEGRATION_URL", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 0, |
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 "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "activerecord", require: "active_record" | |
gem "activejob", require: "active_job" | |
gem "sqlite3" | |
gem "searchkick", git: "https://github.com/ankane/searchkick.git" | |
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
curl -X GET http://localhost:4567 |
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
Xcloud@xcloud199 ~> cat /Library/LaunchDaemons/monit.plist | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>monit</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/bin/monit</string> |
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 url = 'http://localhost:8081/api/v2/deliverable_builds/6db57828-01b5-11e8-a40f-685b358e6aa5' | |
var idExtractor = /([\d\w\-]+)$/g; | |
var idMatch = idExtractor.exec(url); | |
console.log(idMatch[1]); | |
var typeExtractor = /\/([\w\d\_]+)\/[\d\w\-]+$/g; | |
var typeMatch = typeExtractor.exec(url); | |
console.log(typeMatch[1]); |
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 "faker" | |
puts (1..13).map { |i| {name: Faker::RickAndMorty.character, bio: Faker::RickAndMorty.quote, number: rand(1000..9999), is_alive: [true, false].sample} }.reduce({}) {|res, obj| res[obj[:name]] = obj; res }.to_yaml |
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
allomov:~/Downloads/onliner_analyzer → touch .ruby-version | |
allomov:~/Downloads/onliner_analyzer → touch .ruby-gemset | |
allomov:~/Downloads/onliner_analyzer → subl . | |
allomov:~/Downloads/onliner_analyzer → rvm list | |
rvm rubies | |
jruby-9.1.13.0 [ x86_64 ] | |
ruby-2.1.5 [ x86_64 ] | |
ruby-2.3.0 [ x86_64 ] |
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
import java.math.*; | |
public class Operation { | |
double[] operatorsValues; | |
void setOperatorsValues(double[] values) { operatorsValues = values; } | |
String[] getOperationNames() { | |
return String[]{this.getFirstOperationName(), this.getSecondOperationName()} | |
} |
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 {Checkout, Submodule, Repository} = require("nodegit"); | |
Repository.open("/native-repo") | |
.then(function(repository) { | |
return repository.getTagByName("v1.0.8") | |
.then(function(result) { console.dir(result); return result; }) | |
.then(function(tag) { console.dir([tag.targetId(), repository.defaultSignature, "Checkout: HEAD " + tag.targetId()]); return tag; }) | |
.then(function(tag) { repository.setHeadDetached(tag.targetId(), repository.defaultSignature, "Checkout: HEAD " + tag.targetId()) }) | |
}) | |
.then(function() { console.log("done");}) | |
.done() |
NewerOlder