Skip to content

Instantly share code, notes, and snippets.

View trybio123's full-sized avatar

try haryatno trybio123

View GitHub Profile
const TodoItem = (props) => <li onClick={props.onClick}>{props.item.text}</li>
class TodoList extends React.Component {
render() {
const { items, onClick } = this.props;
return (<ul onClick={onClick}>
{items.map((item, index) =>
<TodoItem item={item} key={index} onClick={this.handleItemClick.bind(this, item)}/>)}
</ul>);
}
<ul>
<li *ngFor="let address of addresses">
<app-address ="address"></app-address>
</li>
</ul>
function appendChildren(decorateDivFunction) {
var allDivs = document.querySelectorAll("div");
for (var i = 0; i < allDivs.length; i++) {
var newDiv = document.createElement("div");
decorateDivFunction(newDiv);
allDivs[i].appendChild(newDiv);
}
}
function setup() {
// Write your code here.
var removeEl = document.querySelectorAll('.remove');
removeEl.forEach(function(el){
el.addEventListener('click', function(e){
e.target.parentNode.remove();
});
});
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Avatar</title>
<style>
/* Write your CSS solution here (do not edit the surrounding HTML) */
.avatar{
border-radius: 50%;
width: 150px;
<?php
class Pipeline
{
public static function make_pipeline(...$funcs)
{
return function($arg) use ($funcs)
{
$var = $arg;
foreach($funcs as $key) {
$var = $key($var);
-- Write only the SQL statement that solves the problem and nothing else.
SELECT a.name
FROM employees as a
WHERE a.id NOT IN (
SELECT b.managerId
FROM employees as b
WHERE b.managerId IS NOT NULL
)
-- Write only the SQL statement that solves the problem and nothing else.
select COUNT(id)
from students
where students.firstName = "John"
@trybio123
trybio123 / palindrome.php
Created May 15, 2019 13:15
palindrome test
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$l= strlen($word);
$status=1;
$i=0;
while($i<$l/2 && $status==1){