Skip to content

Instantly share code, notes, and snippets.

View reciosonny's full-sized avatar
🎯
Focusing

Sonny R. Recio reciosonny

🎯
Focusing
View GitHub Profile
@reciosonny
reciosonny / ds.csv
Created October 10, 2021 01:55 — forked from masrab/ds.csv
Visual data structure selector
Name Indexing (Average) Search (Average) Insertion (Average) Deletion (Worst) Indexing (Worst) Search (Worst) Insertion (Worst) Deletion (Worst) Space
Basic Array O(1) O(n) Undefined Undefined O(1) O(n) Undefined Undefined O(n)
Dynamic Array O(1) O(n) O(n) O(n) O(1) O(n) O(n) O(n) O(n)
Singly-Linked List O(n) O(n) O(1) O(1) O(n) O(n) O(1) O(1) O(n)
Doubly-Linked List O(n) O(n) O(1) O(1) O(n) O(n) O(1) O(1) O(n)
Skip List O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(n) O(n) O(n) O(n) O(n log(n))
Hash Table Undefined O(1) O(1) O(1) Undefined O(n) O(n) O(n) O(n)
Binary Search Tree O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(n) O(n) O(n) O(n) O(n)
Cartresian Tree Undefined O(log(n)) O(log(n)) O(log(n)) Undefined O(n) O(n) O(n) O(n)
B-Tree O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(n)
<template>
<div>
<div class="error-panel callout alert" v-if="categoryError">
<h2>
Invalid category selected: '{{ selectionJson.rootCategory }}<span v-if="selectionJson.category">/{{ selectionJson.category }}</span>'.
</h2>
<div class="sub-text">
To continue browsing, please return to the <ps-page-navigator page="home" link-text="home page"></ps-page-navigator>.
</div>
</div>
@reciosonny
reciosonny / component-using-mixin-sample1.vue
Last active October 4, 2021 04:51
Vue - Reused similar functionalities using mixins
<template>
<div class="plp-wrapper" :class="{'adjust-wrapper-background-scroll-plp': dockFacetMenuListToTop}">
<facet-menu-list-reflektion
:rfk-facets="rfkFacets"
:facet-selections="selectedFacets"
:preselected-facets="urlParams"
:rfk-page-config="rfkPageConfig"
:rfk-sort-options="rfkSortOptions"
id="facet-menu-list"
:class="{ 'ps-is-stuck' : !inView.stickyWrapper && (isTouchScreen || storeScrollPosition > minimumScrollPositionForFacetsSticky), 'adjust-with-warning-without-toolbar': stickyWarningOn && !inView.stickyWrapper, 'dock-facets-to-top': dockFacetMenuListToTop && !stickyWarningOn}"
/**
* @param {number} k
*/
var MyCircularQueue = function(k) {
this.arr = new Array(k);
this.headCount = 0;
this.tailCount = 0;
};
/**
const webpack = require("webpack");
const webpackMerge = require("webpack-merge");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const path = require("path");
const modeConfig = env => require(`./modes/webpack.${env}.js`)(env);
const pluginConfig = require("./loadPlugins");
module.exports = ({ mode, presets } = { mode: "development", presets: [] }) => {
//uppercase.js
function uppercase(str, callback) {
callback(str.toUpperCase())
}
module.exports = uppercase
//uppercase.test.js
const uppercase = require('./src/uppercase')
test(`uppercase 'test' to equal 'TEST'`, (done) => {
import SoundPlayer from './sound-player';
const mockPlaySoundFile = jest.fn();
jest.mock('./sound-player', () => {
return jest.fn().mockImplementation(() => {
return {playSoundFile: mockPlaySoundFile};
});
});
class App extends React.Component {
state = { clicked: false, initialized: false };
componentDidMount() {
this.setState({ initialized: true });
}
setClicked = () => {
this.setState({ clicked: true });
@reciosonny
reciosonny / componentHooks.js
Last active December 22, 2019 06:31
componentHooks.js
function App() {
const [initialized, setInitialized] = useState(false);
const [clicked, setClicked] = useState(false);
useEffect(() => {
setInitialized(true);
});
function App() {
const [firstName, setFirstName] = useState("");
const [middleName, setMiddleName] = useState("");
const [lastName, setLastName] = useState("");
return (
<div className="App">
<PersonalInformation
firstName={firstName}
middleName={middleName}