Skip to content

Commit

Permalink
Merge branch 'master' into nikhilkalburgi-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jahenr authored Mar 24, 2024
2 parents aec1828 + 1945c3e commit e3a3594
Show file tree
Hide file tree
Showing 20 changed files with 1,050 additions and 37 deletions.
10 changes: 9 additions & 1 deletion Byobu_CheatSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ Byobu/Tmux:
#Kill split in focus
Ctrl + F6

#Join all splits
Shift + F5

#Kill the current window
Ctrl + A + K

#Move focus to next split
Shift + F3

7 changes: 7 additions & 0 deletions Elasticsearch_CheatSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@

#Check pending tasks
curl -XGET http://localhost:9200/_cat/pending_tasks?v
#Query using URL parameters
curl -X GET http://localhost:9200/samples/_search?q=school:Harvard
#List index mapping
curl -X GET http://localhost:9200/samples

67 changes: 67 additions & 0 deletions Flexbox_CheatSheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@


#Allow Flexbox display
display: flex;

#Align items horizontally
justify-content:
#Options include:
flex-start; - items align to left of container
flex-end; - items align to right of container
center; - items align at center of container
space-between; - equal spacing between items, with first at start and final at end
space-around; - equal spacing around items
space-evenly; - even spacing around items with a full space at either end

#Align items vertically
align-items:
#Options include:
flex-start; - items align to top of container
flex-end; - items align to bottom of container
center; - items align to vertical center of container
baseline; - items align to baseline of container
stretch; - items stretched to fit

#Change direction
flex-direction:
#Options include:
row; - items placed the same as text direction
row-reverse; - items placed opposite to text direction
column; - items are placed top to bottom
column-reverse: items are placed bottom to top

#Align specific item
align-self:
#Options include same values as 'align-items' but for a specific item
#Overrides 'align-items'

#Wrap items
flex-wrap:
#Options include:
nowrap: every items is fit to a single line
wrap: items wrap around to additional lines
wrap-reverse: items wrap around to additional lines in reverse

#Combination of direction and wrap
flex-flow:
#Options include:
row wrap; - sets rows and wraps them
row nowrap;
row reverse nowrap;
column reverse;
column wrap-reverse
column wrap

#Space multiple lines a certain way
align-content:
#Options include:
flex-start; - lines packed at top of container
flex-end; - lines packed at bottom of container
center; lines packed at vertical center of container
space-between: lines display with equal spacing between them
space-around: lines display with equal spacing around them
stretch: lines are stretched to fit the container

#Order items
order:
#Can be positive or negative. Default order value of 0.
112 changes: 112 additions & 0 deletions Flutter_cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Flutter

CheatSheet

# confirm if your flutter SDK is set up correctly and compatible with other platforms, devices and IDE.
`flutter doctor` or `flutter doctor -v`


# create a new flutter project from terminal
`flutter create NAME_OF_APP`

# create a new flutter project and replace the default package name flutter gives you com.example.myappname
`flutter create –org com.mywebsite NAME_OF_APP`


# set a specific language for the Android app and iOS; here we use Java for Android and objective-C for iOS
`flutter create --org=com.mywebsite --android-language=java --ios-language=objc NAME_OF_APP`


# mistakenly deleted a file, create it with its boilerplate codes. This will replace all missing files without creating everything from scratch
`flutter create --no-overwrite --org=com.mywebsite.NAME_OF_APP`


# list all devices connected and supported by the Flutter SDK
`flutter devices`

# get current device id
`flutter --device-id`


# flutter help
`flutter -h`


# run a flutter app
`flutter run`


# to see more outputs while app is trying to build in debug mode
`flutter run -v `


# after making stateless change(changing font size, color, widget size, shape, etc)
`Hot Reload (r): tap small r while app is running`


# after you make changes to class instances or things that will affect app’s current state
`Hot Restart(R): tap big R while app is running`


# take a screenshot from the terminal:
`tap small (s) when running the app in debug mode`


# lost connecting while debugging, connect your app back via
`flutter attach -d <target-platform-name` or simply `flutter attach`


# show all available options while your app is running in debug mode:
`press small (h)`


# list flutter channels.
`flutter channel`


# switch to a flutter channel
`flutter channel CHANNEL_NAME`


# upgrade your Flutter SDK with Dart
`flutter upgrade`


# get current flutter version
`flutter --version`


# list, launch or create emulators
`flutter emulators`


# generate localizations for the Flutter project
`flutter gen-l10n PATH_TO_TRANSLATION_FILE`


# format a dart file
`flutter format PATH_TO_DART_FILE`


# run your tests packages
`flutter test PATH_TO_TEST_FILE`

# add a third party package
`flutter pub add NAME_OF_PACKAGE`


# download the third party package
`flutter pub get`

# remove every temporary files & folders
`flutter clean`


# build the APK file
`flutter build apk`


#Tip: speed up Flutter Development
use the third packages to suit your needs. Google first.
3 changes: 3 additions & 0 deletions Git_CheatSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,6 @@

#Stashing everything (including ignored files)
git stash --all

#Push code from working branch to another branch
git push origin branch1: branch2
1 change: 1 addition & 0 deletions InfluxDB_Cheatsheet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

126 changes: 126 additions & 0 deletions JavaScript_CheatSheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
JavaScript:

# Declare a variable using let or const.
let myVariable = 'hello';
const myConstant = 42;

# Log a message to the console.
console.log('Hello, world!');

# Alert a message to the user.
alert('Hello, user!');

# Prompt the user for input.
let userInput = prompt('What is your name?');

# Declare a function.
function myFunction(arg1, arg2) {
Function body goes here.
}

# Call a function.
myFunction(value1, value2);

# Declare an object.
let myObject = {
key1: 'value1',
key2: 'value2',
key3: 'value3',
};

# Access an object's property.
myObject.key1;

# Declare an array.
let myArray = [1, 2, 3, 4];

# Access an array's element.
myArray[0];

# Declare a for loop.
for (let i = 0; i < myArray.length; i++) {
Loop body goes here.
}

# Declare a while loop.
while (condition) {
Loop body goes here.
}

# Declare an if statement.
if (condition) {
Code to execute if condition is true.
}

# Declare an if-else statement.
if (condition) {
Code to execute if condition is true.
} else {
Code to execute if condition is false.
}

# Declare a switch statement.
switch (expression) {
case value1:
Code to execute if expression equals value1.
break;
case value2:
Code to execute if expression equals value2.
break;
default:
Code to execute if expression doesn't match any case.
}

# Declare a try-catch block.
try {
Code that might throw an error.
} catch (error) {
Code to handle the error.
}

# Declare a timeout function.
setTimeout(function() {
Code to execute after a delay.
}, delay);

# Declare an interval function.
setInterval(function() {
Code to execute repeatedly at an interval.
}, interval);

# Declare a callback function.
function myFunction(callback) {
Code to execute before the callback.
callback();
Code to execute after the callback.
}

# Declare a promise.
let myPromise = new Promise(function(resolve, reject) {
Code that might resolve or reject the promise.
});

# Use the then method of a promise.
myPromise.then(function(result) {
Code to execute if the promise resolves successfully.
}).catch(function(error) {
Code to execute if the promise is rejected.
});

# Declare a class.
class MyClass {
constructor(arg1, arg2) {
Constructor code goes here.
}
myMethod(arg1, arg2) {
Method body goes here.
}
}

# Declare a module.
export function myFunction(arg1, arg2) {
Code to export goes here.
}

# Import a module
import { myFunction } from './my-module.js';
25 changes: 25 additions & 0 deletions K8s_CheatSheet.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#Get the documentation for pod manifests
kubectl explain pods
#Get total nodes in cluster
kubectl get nodes
Expand All @@ -10,5 +13,27 @@
#List contexts added in .kube config
kubectl config list-contexts
#List the running Pods:
kubectl get pods
#Select the context to use
kubectl config use-context <context name>

#Get the password for the e2e user
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'

#Get all pods in all namespaces and list from most resource hungry to less
kubectl top pod --all-namespaces | sort --reverse --key 3 --numeric | less
#Describe specific pod in deployment that is in the selected namespace with a bit more detail
kubectl -n <namespace> describe deployments.apps <pod name>
#Delete resources
kubectl delete

#Get a deployment's status subresource
kubectl get deployment nginx-deployment --subresource=status

#List all services in the namespace
kubectl get services

Loading

0 comments on commit e3a3594

Please sign in to comment.