Skip to content

Instantly share code, notes, and snippets.

@vishal2376
vishal2376 / Place.kt
Last active May 19, 2024 09:08
Image Reflection with cool animation using Jetpack Compose
data class Place(
val name: String,
val resId: Int
)
@marians
marians / Chromium Linux.md
Last active May 19, 2024 09:03
How to install CA certificates and PKCS12 key bundles on different platforms

We install certutil and pk12util if necessary:

sudo apt install libnss3-tools

On Linux, Chromium uses the NSS Shared DB. Check if you have the ~/.pki/nssdb directory:

ls $HOME/.pki/nssdb
import ReactSelect from 'react-select'
export const REACT_SELECT_CUSTOM_STYLES = {
control: (provided) => ({
...provided,
fontSize: '0.875rem',
lineHeight: '1.25rem'
}),
valueContainer: (provided) => ({
...provided,
@alivx
alivx / ansible.cfg
Created May 23, 2020 15:15
Default Ansible config file
# Example config file for ansible -- https://ansible.com/
# =======================================================
# Nearly all parameters can be overridden in ansible-playbook
# or with command line flags. Ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory, or /etc/ansible/ansible.cfg, whichever it
# finds first
# For a full list of available options, run ansible-config list or see the
@danieldogeanu
danieldogeanu / RenameGitBranch.md
Last active May 19, 2024 08:25
How to rename your Git master branch to main.

To rename your Git master branch to main, you must do the following steps:

  1. Navigate to your repository in the command line and issue the following commands: - git branch -m master main - git push -u origin main

  2. Change your default branch on GitHub by going to your GitHub repository in your browser, and navigate to Settings > Branches and click on the dropdown and switch from master to main and click Update (this will only show if you have two or more branches). The main branch is now your default branch.

  3. Update the tracking of the branch from your command line with the following command: - git branch -u origin/main main

@ghassani
ghassani / QueryBuilder.php
Created September 19, 2018 18:28
Simple PHP SQL Query Builder for PDO
<?php
class QueryBuilder {
const QUERY_SELECT = 1;
const QUERY_INSERT = 2;
const QUERY_UPDATE = 3;
const QUERY_DELETE = 4;
const QUERY_REPLACE = 5;
const PARAMETER_STRING = 1;
@rawaludin
rawaludin / psd2png.sh
Created July 11, 2013 05:56
Batch Convert PSD to PNG in Mac OS X
#!/bin/bash
for i in *psd
do
name=${i%.psd}
convert "$name.psd[0]" -resize 100% "$name.png"
done
@ziritrion
ziritrion / pythondata.md
Last active May 19, 2024 07:20
Python and libraries cheat sheet

Python

Lists

  • [1, 2, 3, 4, 5]

Power operator (2^5)

  • 2 ** 5

Square root (power operator trick)

  • 9 ** 0.5
@ziritrion
ziritrion / git.md
Last active May 19, 2024 07:19
git cheatsheet

Basic git

  1. Make sure your local copy of the selected branch is updated.
    1. Without overwriting anything
      • git fetch
    2. If you already fetched or you are ready to overwrite your local copy, then pull
      • git pull
  2. Check your repo branches
    1. Local branches
  • git branch
@ziritrion
ziritrion / pythonenvs.md
Last active May 19, 2024 07:18
Cheatsheet for Conda, Pipenv

Conda

  1. Create a virtual environment
    • conda create --name my_env_name python=3.8 or whatever Python version you may need.
  2. List available envs (2 different ways
    • conda env list
    • conda info --envs
  3. Activate virtual env
    • conda activate my_env_name
  4. Deactivate current environment