This file contains 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 fs = require('fs'); | |
const util = require('util'); | |
const exec = util.promisify(require('child_process').exec); | |
// ANSI escape codes for colors | |
const colors = { | |
reset: '\x1b[0m', | |
red: '\x1b[31m', | |
green: '\x1b[32m', | |
yellow: '\x1b[33m', |
This file contains 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
import React, {FunctionComponent} from 'react'; | |
import {StyleSheet, View, ViewStyle} from 'react-native'; | |
interface Props { | |
size: number; | |
color: string; | |
axis?: 'horizontal' | 'vertical'; | |
style?: ViewStyle; | |
width?: number; | |
} |
This file contains 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
#include <iostream> | |
using namespace std; | |
const int ROW_SIZE = 3; | |
const int COLUMN_SIZE = 3; | |
void CheckMatrix(int m[][COLUMN_SIZE], int ROW_SIZE) | |
{ | |
if (COLUMN_SIZE != ROW_SIZE) |
This file contains 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
#include <iostream> | |
#include <cstring> | |
#include <regex> | |
#include <queue> | |
#include <stack> | |
using namespace std; | |
class UserAccountType | |
{ |
This file contains 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
import React from 'react' | |
import { View, Text, TextInput, StyleSheet} from 'react-native' | |
export default class Input extends React.Component { | |
focus() { | |
this.input.focus(); | |
} | |
blur() { | |
this.input.blur(); |
This file contains 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 validateForm = () => { | |
$('input').each(function() { | |
const $this = $(this); | |
const $button = $('button'); | |
if ($this.val() === '' || $this.val().length <= 0) { | |
$button.attr('disabled', 'disabled'); | |
} else if (!$button.attr('disabled')) { | |
$button.removeAttr('disabled'); | |
} | |
}) |
This file contains 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
module Ex25 | |
# This function will break up words for us. | |
def Ex25.break_words(stuff) | |
return stuff.split(' ') | |
end | |
# Sorts the words. | |
def Ex25.sort_words(words) | |
return words.sort() |
This file contains 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
// https://codeburst.io/javascript-array-distinct-5edc93501dc4 | |
export const uniqueArray = (array) => { | |
console.log(array) | |
const result = [] | |
const map = new Map() | |
for (const item of array) { | |
if(!map.has(item.imdbID)){ | |
map.set(item.imdbID, true) | |
result.push({ | |
imdbID: item.imdbID, |