Skip to content

Instantly share code, notes, and snippets.

Avatar
🇧🇷

Newton Samin Urbanetz nsrau

🇧🇷
View GitHub Profile
@nsrau
nsrau / test-request.ts
Created Dec 23, 2020
create a dynamic data to test
View test-request.ts
import axios, { Method } from 'axios';
(async (forNumber) => {
const arr = Array(10 * forNumber).fill(null).map((n, i) => i)
for (const i of arr) {
try {
const PreviousMessages = arr.slice(0, i + 1).fill(null).map((n, index) => {
return {
msg: index,
createdOn: new Date().toISOString()
@nsrau
nsrau / Base64.js
Created Nov 10, 2020
btoa, atob - NODE JS - ES6
View Base64.js
class Base64 {
constructor() {
}
// A helper that returns Base64 characters and their indices.
static chars = {
ascii: function () {
return 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
},
View .gitconfig
[core]
editor = code --wait
pager =
[push]
followTags = true
[alias]
c = !git add --all && git commit -m
s = !git status -s
l = !git log --pretty=format:'%C(blue)%h%C(red)%d %C(white)%s - %C(cyan)%cn, %C(green)%cr'
amend = !git add --all && git commit --amend --no-edit
View PluginGrid.css
.react-grid-layout{position:relative;transition:height .2s ease}.react-grid-item{transition:all .2s ease;transition-property:left,top}.react-grid-item.cssTransforms{transition-property:transform}.react-grid-item.resizing{z-index:1;will-change:width,height}.react-grid-item.react-draggable-dragging{transition:none;z-index:3;will-change:transform}.react-grid-item.dropping{visibility:hidden}.react-grid-item.react-grid-placeholder{background:red;opacity:.2;transition-duration:.1s;z-index:2;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px;bottom:0;right:0;cursor:se-resize}.react-grid-item>.react-resizable-handle::after{content:'';position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid rgba(0,0,0,.4);border-bottom:2px solid rgba(0,0,0,.4)}.react-resizable-hide>.react-resizable-handle{display:none}body{padding:20px}#content{width:100%}.react-grid-layout{b
View PluginGrid.js
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
window['process'] = {
env: {NODE_ENV: 'prod'}
}
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
View PluginTwo.js
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var React__default = _interopDefault(React);
var PluginTwo = function PluginTwo(_ref) {
var count = _ref.count,
handlerClick = _ref.handlerClick;
var _useState = React.useState(count),
state = _useState[0],
View ExampleComponent.js
var React__default = React;
var PluginOne = function PluginOne(_ref) {
var count = _ref.count,
handlerClick = _ref.handlerClick;
var _useState = React.useState(count),
state = _useState[0],
setState = _useState[1];
return React__default.createElement("div", null, React__default.createElement("h2", null, "Plugin One"), React__default.createElement("hr", null), React__default.createElement("button", {
@nsrau
nsrau / localstorage.service.ts
Last active Oct 7, 2018
Local Storage html5 - service angular
View localstorage.service.ts
export class LocalstorageService {
private _localstorage: Storage = window.localStorage;
private _cache_duration = 15;
constructor() {
if (!this.supportsLocalStorage()) {
console.error('LocalstorageService: No HTML5 localStorage Support');
} else {
@nsrau
nsrau / Git push deployment in 7 easy steps.md
Created Jul 23, 2017 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
View Git push deployment in 7 easy steps.md