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 tree = JSON.parse(`...`); // Add JSON here. | |
function dfs(node) { | |
if(!node) | |
return; | |
console.log(node.v); | |
dfs(node.a); | |
dfs(node.b); | |
} |
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
{ | |
"v": 21, | |
"a": { | |
"v": 15, | |
"a": { | |
"v": 200, | |
"a": { | |
"v": 12 | |
}, | |
"b": { |
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 std = @import("std"); | |
const stdout = std.io.getStdOut().writer(); | |
fn print_help() !void { | |
try stdout.print("{s}\n" , .{"-" ** 25}); | |
try stdout.print("0: Exit\n", .{}); | |
try stdout.print("1: Show help\n", .{}); | |
try stdout.print("2: Print Node.js version\n", .{}); | |
try stdout.print("{s}\n" , .{"-" ** 25}); | |
} |
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
Widget _renderSteps(List<Step> steps) { | |
return ExpansionPanelList.radio( | |
children: steps.map<ExpansionPanelRadio>((Step step) { | |
return ExpansionPanelRadio( | |
headerBuilder: (BuildContext context, bool isExpanded) { | |
return ListTile( | |
title: Text(step.title), | |
); | |
}, | |
body: ListTile( |
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
jobs: | |
build-linux-arm64: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Run | |
uses: uraimo/run-on-arch-action@v2 | |
id: build-package | |
with: |
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
def get_short_name(full_name): | |
names = full_name.split(' ') | |
short_name = '' | |
for i in range(len(names)): | |
if i < len(names) - 1: | |
short_name += names[i][0] + '. ' | |
else: | |
short_name += names[i] | |
return short_name; |
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
function get_short_name() { | |
short_name='' | |
for i in ${!fullname[@]}; do | |
if ((i < ${#fullname[@]} - 1)); then | |
short_name+="${fullname[i]::1}. " | |
else | |
short_name+=${fullname[i]} | |
fi | |
done |
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
# Add an "alert" alias for long running commands. Use like so: | |
# sleep 10; alert | |
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' |
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
// Test |
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 { useState } from 'react'; | |
import InputMask from 'react-input-mask'; | |
function TimeInput(props) { | |
let mask = 'dD-mM-YYYY'; | |
let formatChars = { | |
'Y': '[0-9]', | |
'd': '[0-3]', | |
'D': '[0-9]', | |
'm': '[0-1]', |
NewerOlder