Skip to content

Instantly share code, notes, and snippets.

View Knyazik01's full-sized avatar

Viktor Kniahnitskyi Knyazik01

View GitHub Profile
@rproenca
rproenca / Clipboard.js
Last active April 10, 2024 05:33
Copy text to clipboard using Javascript. It works on Safari (iOS) and other browsers.
window.Clipboard = (function(window, document, navigator) {
var textArea,
copy;
function isOS() {
return navigator.userAgent.match(/ipad|iphone/i);
}
function createTextArea(text) {
textArea = document.createElement('textArea');
@gregnavis
gregnavis / sudoku.rb
Created April 13, 2013 22:44
A simple Sudoku solver in Ruby.
class Sudoku
SIZE = 9
NUMBERS = (1..9).to_a
def initialize
@board = Array.new(SIZE) { Array.new(SIZE, nil) }
end
def [](x, y)
@board[y][x]