Data Structure | Access | Search | Insertion | Deletion | Comments |
---|---|---|---|---|---|
Array | 1 | n | n | n | |
Stack | n | n | 1 | 1 | |
Queue | n | n | 1 | 1 | |
Linked List | n | n | 1 | n | |
Hash Table | - | n | n | n | In case of perfect hash function costs would be O(1) |
Binary Search Tree | n | n | n | n | In case of balanced tree costs would be O(log(n)) |
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
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
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 crypto = require('crypto'); | |
const algorithm = 'aes-192-cbc'; | |
const password = '3zTvzr3p67VC61jmV54rIYu1545x4TlY'; | |
const key = crypto.scryptSync(password, 'salt', 24); | |
const iv = Buffer.alloc(16, 0); | |
function encrypt(text) { | |
const cipher = crypto.createCipheriv(algorithm, key, iv) |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
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
<?php | |
// Installed the need packages with Composer by running: | |
// $ composer require aws/aws-sdk-php | |
$filePath = "https://example.com/test.png"; | |
require 'vendor/autoload.php'; | |
$bucketName = 'YOUR_BUCKET_NAME'; | |
$filePath = './YOUR_FILE_NAME.png'; |
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 | |
rm -Rf /Applications/Android\ Studio.app | |
rm -Rf ~/Library/Preferences/AndroidStudio* | |
rm -Rf ~/Library/Preferences/com.google.android.* | |
rm -Rf ~/Library/Preferences/com.android.* | |
rm -Rf ~/Library/Application\ Support/AndroidStudio* | |
rm -Rf ~/Library/Logs/AndroidStudio* | |
rm -Rf ~/Library/Caches/AndroidStudio* | |
rm -Rf ~/.AndroidStudio* |
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
// GLOBAL | |
console.log(this); //--> window | |
// FUNCTION | |
function discoverThis() { | |
console.log(this); //--> window | |
} | |
discoverThis(); | |
// OBJECT |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace CSharpWork | |
{ | |
public class MyLinkedList<T> where T: IComparable | |
{ | |
class Node<G> |
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 "regenerator-runtime/runtime"; | |
import { useState } from "react"; | |
import { useAsyncDebounce } from "react-table"; | |
const ColumnFilter = ({ column }) => { | |
const { filterValue, setFilter } = column; | |
const [value, setValue] = useState(filterValue); | |
const onChange = useAsyncDebounce((value) => { | |
setFilter(value || undefined); | |
}, 300); |