GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)
- not equal
~=
- logical AND
&&
class Sudoku | |
def initialize(board_string) | |
p "Start game!" | |
board(board_string) | |
end | |
def solve!(string) | |
create_string_array(string) |
# Eg. PORT_NUMBER -> 3000 | |
kill -9 $(lsof -t -i:PORT_NUMBER -sTCP:LISTEN) |
#!/usr/bin/env ruby | |
require "english" | |
require "rubocop" | |
ADDED_OR_MODIFIED = /A|AM|^M/.freeze | |
file_list = `git status --porcelain`.split(/\n/) | |
file_list = file_list.select do |file_name_with_status| | |
file_name_with_status =~ ADDED_OR_MODIFIED |
git for-each-ref --sort=-committerdate --format="%(refname)" refs/heads > all | head -n 10 > first-10 | |
diff first-10 all | sed "s/> refs\/heads\///g" | xargs git branch -D | rm all | rm first-10 |
GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)
~=
&&
function validEmail(email) { // see: | |
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; | |
return re.test(email); | |
} | |
function validateHuman(honeypot) { | |
if (honeypot) { //if hidden form filled up | |
console.log("Robot Detected!"); | |
return true; | |
} else { |
# move all files from current directory to upper directory | |
mv * ../ | |
# copy all files in 'a' folder to 'b' folder | |
cp -a /a/. /b/ |
# Open Terminal | |
vim ~/.vimrc | |
# Mac OS-X -> .vimrc ; Window -> .gvimrc | |
# Add it in the file and adjust the font size (h12) accordingly | |
set guifont=Menlo\ Regular:h15 |
# Do this to ensure that you still can safely return to the original state if the deploy is unsuccessful | |
APPNAME=production | |
# Backing up the data from production (or apps name) to your heroku dashboard | |
heroku pg:backups capture -r APPNAME | |
# Downloading the data from the heroku dashboard to local machine | |
curl -o {PATHNAME}.dump `heroku pg:backups public-url -r APPNAME` |
function pairwise(arr, arg) { | |
var ans = []; | |
for(var i = 0; i < arr.length ; i++){ | |
var elem = arr.shift(); | |
var pairElemIndex = arr.indexOf(arg - elem); | |
if( pairElemIndex !== -1 ){ | |
ans.push(i,pairElemIndex + i + 1); | |
delete arr[pairElemIndex]; | |
} | |
} |