// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
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.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 24, | |
// font family with optional fallbacks | |
fontFamily: '"Fira Code", Menlo, "DejaVu Sans Mono", "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: '#1df9ca', |
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
#!/bin/bash | |
# NOTE: actually it would be nice to add something like the branch and SHA, but for the sake of demonstration I'm just using this file to feed Wakatime | |
# these variables are not used, but they might be useful; for someone else to play around | |
MESSAGE=$1 | |
SHA=$(git rev-parse HEAD) | |
BRANCH=$(git symbolic-ref --short HEAD) | |
# give it a 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
const maskDate = value => { | |
let v = value.replace(/\D/g,'').slice(0, 10); | |
if (v.length >= 5) { | |
return `${v.slice(0,2)}/${v.slice(2,4)}/${v.slice(4)}`; | |
} | |
else if (v.length >= 3) { | |
return `${v.slice(0,2)}/${v.slice(2)}`; | |
} | |
return v | |
} |
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
/* FIX Materialize error label */ | |
label.invalid { | |
position: relative; | |
top: -1rem; | |
left: 0rem !important; | |
font-size: 0.8rem; | |
color: #f44336 !important; | |
-webkit-transform: translateY(0%); | |
-ms-transform: translateY(0%); | |
-o-transform: translateY(0%); |
None of the string methods modify this
– they always return fresh strings.
-
charAt(pos: number): string
ES1Returns the character at index
pos
, as a string (JavaScript does not have a datatype for characters).str[i]
is equivalent tostr.charAt(i)
and more concise (caveat: may not work on old engines).
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 <assert.h> | |
#include <stdarg.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
enum type { | |
NIL, |
# Enumerate databases
sqlmap --dbms=mysql -u "$URL" --dbs
# Enumerate tables
sqlmap --dbms=mysql -u "$URL" -D "$DATABASE" --tables
# Dump table data
sqlmap --dbms=mysql -u "$URL" -D "$DATABASE" -T "$TABLE" --dump
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
""" | |
Exemplo para ajudar a responder o problema de aninhamento em https://gist.github.com/AndersonFirmino/b0300923094a5a8450018c5bd32c9de8 | |
""" | |
from itertools import filterfalse | |
from functools import partial | |
from random import choice, random | |
def pipe(*funcs): | |
def inner(data, funcs=funcs): | |
result = data |
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 odd_or_even(flag, limit): | |
"""Retorna um numero aleatorio pelo limite | |
:param flag: | |
:param limit: | |
:return: | |
""" | |
if flag: | |
return choice(sorted(filter(lambda x: x % 2 == 0, tuple(range(limit))), key=lambda x: random())) | |
return choice(sorted(filter(lambda x: x % 2 != 0, tuple(range(limit))), key=lambda x: random())) |