-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
17,968 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# NPM # | ||
########## | ||
# Ignore all directories called node_modules in current folder and any subfolders. | ||
node_modules/ | ||
/node_modules/ | ||
|
||
# Packages # | ||
############ | ||
*.7z | ||
*.dmg | ||
*.gz | ||
*.bz2 | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
*.tgz | ||
*.map | ||
|
||
# Logs and databases # | ||
###################### | ||
*.log | ||
*.sql | ||
*.env | ||
|
||
# OS generated files # | ||
###################### | ||
**.DS_Store* | ||
ehthumbs.db | ||
Icon? | ||
Thumbs.db | ||
._* | ||
|
||
# Vim generated files # | ||
###################### | ||
*.un~ | ||
|
||
# SASS # | ||
########## | ||
**/.sass-cache | ||
**/.sass-cache/* | ||
**/.map | ||
|
||
# Composer # | ||
########## | ||
!assets/js/vendor/ | ||
wpcs/ | ||
/vendor/ | ||
|
||
|
||
# Project related | ||
################# | ||
images/inspire.png |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"default": true, | ||
"MD041": false, | ||
"MD010": false, | ||
"MD002": false, | ||
"MD001": false, | ||
"MD022": false, | ||
"MD024": false, | ||
"MD013": false, | ||
"MD033": false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# NPM # | ||
########## | ||
# Ignore all directories called node_modules in current folder and any subfolders. | ||
node_modules/ | ||
/node_modules/ | ||
|
||
# Packages # | ||
############ | ||
*.7z | ||
*.dmg | ||
*.gz | ||
*.bz2 | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
*.tgz | ||
*.map | ||
|
||
# Logs and databases # | ||
###################### | ||
*.log | ||
*.sql | ||
*.env | ||
|
||
# OS generated files # | ||
###################### | ||
**.DS_Store* | ||
ehthumbs.db | ||
Icon? | ||
Thumbs.db | ||
._* | ||
|
||
# Vim generated files # | ||
###################### | ||
*.un~ | ||
|
||
# SASS # | ||
########## | ||
**/.sass-cache | ||
**/.sass-cache/* | ||
**/.map | ||
|
||
# Composer # | ||
########## | ||
!assets/js/vendor/ | ||
wpcs/ | ||
/vendor/ | ||
|
||
# Bower # | ||
########## | ||
assets/bower_components/* | ||
|
||
# Codekit # | ||
########## | ||
/codekit-config.json | ||
*.codekit | ||
**.codekit-cache/* | ||
|
||
# Compiled Files and Build Dirs # | ||
########## | ||
/README.html | ||
|
||
# PhpStrom Project Files # | ||
.idea/ | ||
library/vendors/composer | ||
assets/img/.DS_Store | ||
|
||
# NPM Ignore. | ||
/imgages | ||
/demo | ||
/.vscode | ||
images/shades-of-purple.gif | ||
images/shades-of-purple.jpg |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"dry-run": false, | ||
"verbose": false, | ||
"force": true, | ||
"non-interactive": true, | ||
"increment": "minor", | ||
"beforeChangelogCommand": "auto-changelog", | ||
"safeBump": false, | ||
"src": { | ||
"commitMessage": "🍧 Release %s", | ||
"tagAnnotation": "🍧 Release %s" | ||
}, | ||
"npm": { | ||
"publish": true | ||
}, | ||
"github": { | ||
"release": true, | ||
"releaseName": "🍧 %s" | ||
}, | ||
"prompt": { | ||
"src": { | ||
"status": true, | ||
"commit": true, | ||
"tag": true, | ||
"push": true, | ||
"release": true, | ||
"publish": true | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"python.linting.enabled": false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// https://www.codingame.com/training/hard/cryptarithm | ||
|
||
/** | ||
* Generates all permutations of a set. | ||
* @param {Array|String} arr - The set of elements. | ||
* @param {Number} size - Number of elements to choose from the set. | ||
*/ | ||
function* permutation(arr, size = arr.length) { | ||
const data = []; | ||
const indicesUsed = []; | ||
yield* permutationUtil(0); | ||
|
||
/** | ||
* @param {Number} index of permutation | ||
* @return {Generator} | ||
*/ | ||
function* permutationUtil(index) { | ||
if (index === size) { | ||
return yield this.clones ? data.slice() : data; | ||
} | ||
for (let i = 0; i < arr.length; i++) { | ||
if (!indicesUsed[i]) { | ||
indicesUsed[i] = true; | ||
data[index] = arr[i]; | ||
yield* permutationUtil(index + 1); | ||
indicesUsed[i] = false; | ||
} | ||
} | ||
} | ||
} | ||
|
||
// We generate a permutation and checking if the sum is valid | ||
const r = () => readline().split(''); | ||
const words = [...Array(+readline())].map(() => r()); | ||
const wordsTotal = r(); | ||
|
||
const dictionary = [...new Set([...words, wordsTotal].flat())].sort(); | ||
|
||
const permutationGenerator = | ||
permutation([...Array(10).keys()], dictionary.length); | ||
|
||
for (let permutation of permutationGenerator) { | ||
const keyValueArray = dictionary.map((v, i) => [v, permutation[i]]); | ||
const cryptMap = new Map(keyValueArray); | ||
if (cryptMap.get(wordsTotal[0]) === 0) continue; | ||
|
||
const wordToNumber = | ||
(arr) => +arr.map((char) => cryptMap.get(char)).join(''); | ||
|
||
const sumWords = | ||
words.map((word) => wordToNumber(word)) | ||
.reduce((sum, curr) => sum+=curr); | ||
|
||
const sumTotal = wordToNumber(wordsTotal); | ||
|
||
if (sumWords === sumTotal) { | ||
cryptMap.forEach((value, key) => console.log(key, value)); | ||
break; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import * as TestUtils from 'react-dom/test-utils' | ||
import CheckboxWithLabel from '../CheckboxWithLabel' | ||
|
||
it('CheckboxWithLabel changes the text after click', () => { | ||
// Render a checkbox with label in the document | ||
const checkbox = TestUtils.renderIntoDocument( | ||
<CheckboxWithLabel labelOn="On" labelOff="Off" /> | ||
) | ||
|
||
const checkboxNode = ReactDOM.findDOMNode(checkbox) | ||
|
||
// Verify that it's Off by default | ||
expect(checkboxNode.textContent).toEqual('Off') | ||
|
||
// Simulate a click and verify that it is now On | ||
TestUtils.Simulate.change( | ||
TestUtils.findRenderedDOMComponentWithTag(checkbox, 'input') | ||
) | ||
expect(checkboxNode.textContent).toEqual('On') | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(ns hello.world.clojure) | ||
|
||
(defn sum [& numbers] | ||
(if (empty? numbers) | ||
0 | ||
(reduce + 0 numbers))) | ||
|
||
(defn print-name [{:keys [first last age]}] | ||
(println (str "Your name is " first " " last " and you are " age " years old."))) | ||
|
||
(defn set-age [person new-age] | ||
(assoc person :age new-age)) | ||
|
||
(defn hello-world [] | ||
(let [john {:first "John" :last "Smith" :age 65} | ||
jack {:first "Jack" :last "Road" :age 76} | ||
george {:first "George" :last "Way" :age 23} | ||
george-junior (assoc george :age 6) | ||
all-persons [john jack george george-junior]] | ||
|
||
(doseq [person all-persons] | ||
(print-name person)) | ||
|
||
(println (str "Total age is: " (apply sum (map :age all-persons)))))) | ||
|
||
(hello-world) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(ns hello.world.clojurescript | ||
(:require [reagent.core :as r]) | ||
|
||
(def counter (r/atom 0)) | ||
(def text-component-style {:background-color :grey | ||
:border "1px solid black" | ||
:padding "5px"}) | ||
|
||
(defn counter-clicked [] | ||
(.log js/console "You clicked the counter component.") | ||
(swap! counter inc)) | ||
|
||
(defn text-counter [text] | ||
[:div {:on-click counter-clicked | ||
:style text-component-style}) | ||
(str text @counter]) | ||
|
||
(defn main-component [] | ||
[:div | ||
[:p {:style {:color :red}} "Hello world! Click the element below:"] | ||
[text-counter "Clicked: "]]) |
Oops, something went wrong.