Skip to content

Instantly share code, notes, and snippets.

View juliaamosova's full-sized avatar
🏠
Working from home

Julia Amosova juliaamosova

🏠
Working from home
View GitHub Profile
@juliaamosova
juliaamosova / you-are-old.js
Created September 29, 2017 03:33
Class vs. Instance Challenge
process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;
process.stdin.on('data', function (data) {
input_stdin += data;
});
@juliaamosova
juliaamosova / plugin.php
Last active April 1, 2018 01:30 — forked from joncave/plugin.php
An intentionally vulnerable plugin developed for WordPress plugin author education.http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/
<?php
/* Plugin Name: Damn Vulnerable WordPress Plugin
* Description: Intentionally vulnerable plugin for plugin author education
* Version: 0.1
* Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/
* Author: Jon Cave
* Author URI: http://joncave.co.uk
* License: GPLv2+
*
* DO NOT RUN THIS PLUGIN ON AN INTERNET ACCESSIBLE SITE
@juliaamosova
juliaamosova / first-word.js
Last active May 3, 2018 01:30
Checkio: Find the first word in a given string.
/*
You are given a string where you have to find its first word.
When solving a task pay attention to the following points:
There can be dots and commas in a string.
A string can start with a letter or, for example, a dot or space.
A word can contain an apostrophe and it's a part of a word.
The whole text can be represented with one word and that's it.
Input: A string.
@juliaamosova
juliaamosova / second-index.js
Last active May 3, 2018 01:29
Checkio: Return the second index of a symbol in a given text.
/*
You are given two strings and you have to find an index of the second occurrence of the second string in the first one.
Let's go through the first example where you need to find the second occurrence of "s" in a word "sims". It’s easy to find its first occurrence with a function indexOf which will point out that "s" is the first symbol in a word "sims" and therefore the index of the first occurrence is 0. But we have to find the second "s" which is 4th in a row and that means that the index of the second occurrence (and the answer to a question) is 3.
Input: Two strings.
Output: Int or undefined
*/