This file contains hidden or 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
| #!/usr/bin/env python | |
| ''' | |
| Usage: | |
| python cnm.py <input_file> <output_file> | |
| ''' | |
| import heapq | |
| import sys | |
| import time |
This file contains hidden or 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
| data <- read.csv( | |
| "https://docs.google.com/spreadsheets/d/1rz8NGk05zQMpwK_DzSaxxBGnBrcyfzs5kjeraYwbJGY/export?format=csv&gid=326936124" | |
| ) | |
| df <- data.frame( | |
| date = as.Date(data$date), | |
| ocurrencia = data$ocurrencia, | |
| contingencia = data$contingencia, | |
| fase = 0, | |
| average = 0 | |
| ) |
This file contains hidden or 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
| <script> | |
| import { store } from "@wordpress/interactivity"; | |
| store({ | |
| actions: { | |
| toggle: ({ context }) => context.isOpen = !context.isOpen, | |
| }, | |
| }); | |
| </script> |
This file contains hidden or 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
| <button id="toggle-button">Toggle Element</button> | |
| <p>This element is now visible!</p> | |
| <script> | |
| const button = document.getElementById("toggle-button"); | |
| button.addEventListener("click", () => { | |
| const element = document.getElementById("element"); | |
| if (element) { | |
| element.remove(); | |
| } else { |
This file contains hidden or 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
| #!/usr/local/bin/fish | |
| function rbase | |
| set STASH_NAME (date +"%Y-%m-%d--%H:%M:%S") | |
| set CURR_BRANCH (git rev-parse --abbrev-ref HEAD) | |
| ## Fetch from all remotes | |
| git fetch --all |
This file contains hidden or 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
| let boardState = [0, 0, 0, 0, 0, 0, 0, 0, 0]; | |
| // 1 is X | |
| // 2 is O | |
| const winningIndices = [ | |
| [0, 1, 2], | |
| [3, 4, 5], | |
| [6, 7, 8], | |
| [0, 3, 6], |
This file contains hidden or 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
| export default function useLoading() { | |
| const [loadingState, setLoadingState] = React.useState({ | |
| isLoading: true, | |
| hasError: false | |
| }); | |
| const loadPromise = aPromise => { | |
| setLoadingState({ isLoading: true, hasError: false }); | |
| return aPromise | |
| .then((...args) => { |
This file contains hidden or 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
| function flatten(arr) { | |
| // We could also always return an empty array if the arr argument is not an array | |
| // That might or might not be what we want. | |
| if (!Array.isArray(arr)) { | |
| throw new TypeError(`The argument arr is not an Array!`); | |
| } | |
| let result = []; | |
| for (let i = 0; i < arr.length; i++) { | |
| const element = arr[i]; |
This file contains hidden or 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
| for branch in `git for-each-ref --format="%(refname)" refs/heads`; do | |
| echo $branch :; git ls-tree -r --name-only $branch | grep '<foo>' | |
| done |
This file contains hidden or 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 array = (len) => Array(len).fill().map((e, i) => (i)); | |
| /* | |
| * > console.log(array(3)); | |
| * > [0,1,2] | |
| * | |
| */ |
NewerOlder