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
| const timeout = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | |
| const randomInteger = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min; | |
| const contextMenuClick = (element) => element.dispatchEvent(new MouseEvent('contextmenu', { | |
| bubbles: true, | |
| cancelable: true, | |
| view: window, | |
| })) | |
| const messages = () => [...document.querySelectorAll('[id^=message].ActionMessage')] | |
| .filter(e => e.textContent.includes(' joined the group')); | |
| const deleteMessage = async (e) => { |
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
| git filter-repo --force --replace-refs delete-no-add --commit-callback ' | |
| if commit.author_email == b"old_email@domain": | |
| commit.author_email = b"new_private_email@domain" | |
| commit.author_name = b"username" | |
| commit.committer_email = b"new_private_email@domain" | |
| commit.committer_name = b"username" | |
| ' |
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
| [ | |
| { "name": "leroy", "kills": 25, "banned": false }, | |
| { "name": "jenkins", "kills": 30, "banned": false }, | |
| { "name": "cheater", "kills": 999, "banned": true }, | |
| { "name": "n00b", "kills": 0, "banned": false } | |
| ] |
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] | |
| name = "tungstenite-example" | |
| version = "0.0.1" | |
| authors = ["Fedcomp"] | |
| edition = "2018" | |
| [dependencies] | |
| tokio-tungstenite = { version = "0.10.1", features = ["tls"] } | |
| tokio = { version = "0.2.21", features = ["full"] } | |
| futures = "0.3.5" |
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
| # frozen_string_literal: true | |
| source "https://rubygems.org" | |
| git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
| # gem "rails" | |
| gem 'rails', '~> 5.0' | |
| gem 'pry-byebug' |
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
| docker-compose --run --rm ruby test.rb |
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
| # Geo/RGeo tools | |
| class GeoService | |
| # @!method line(start_point, end_point) Create LineString from start to end points | |
| # @param start_point [RGeo::Geographic::SphericalPointImpl] | |
| # @param end_point [RGeo::Geographic::SphericalPointImpl] | |
| # @return [RGeo::Cartesian::LineStringImpl] | |
| # @!method line_string(points) Create LineString from array of coordinates | |
| # @param points [Array<RGeo::Geographic::SphericalPointImpl>] | |
| # @return [RGeo::Geographic::SphericalLineStringImpl] | |
| delegate :line, :line_string, to: :spherical_factory |
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
| require 'pathname' | |
| require 'digest' | |
| Pathname.new(Dir.pwd).children.select(&:file?).each do |file| | |
| next if file.basename.to_s.start_with?('hashed_') || file.extname == '.rb' | |
| file_md5 = Digest::MD5.file(file).hexdigest | |
| old_name = file.basename | |
| new_name = "hashed_#{file_md5}_#{old_name}" | |
| puts "#{old_name} -> #{new_name}" | |
| File.rename old_name, new_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
| mkdir %appdata%\Carbon\.debug\replay | |
| mkdir %appdata%\Carbon\Airmech\.debug\replay | |
| mkdir %appdata%\Carbon\AirmechCanary\.debug\replay | |
| mkdir %appdata%\Carbon\AirmechSteam\.debug\replay |
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
| USER_ID=1000 |
NewerOlder