Skip to content

Instantly share code, notes, and snippets.

@dinhquochan
dinhquochan / install.sh
Created July 24, 2023 15:39
Install PHP 8.2, Composer, MySQL 8 for Laravel Development on Ubuntu 22.04
## PHP
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.2-cli php8.2-dev php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-imagick \
php8.2-curl php8.2-imap php8.2-mysql php8.2-mbstring php8.2-xml php8.2-zip \
php8.2-bcmath php8.2-soap php8.2-intl php8.2-readline php8.2-ldap php8.2-msgpack \
php8.2-igbinary php8.2-redis php8.2-memcache php8.2-pcov php8.2-xdebug
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
[SerializeField] private Transform mainCamera;
[SerializeField] private float sensitivity;
[SerializeField] private Rigidbody rigidBody;
[SerializeField] private float moveForce;
[SerializeField] private float maxMoveSpeed;
@subfuzion
subfuzion / curl.md
Last active May 5, 2024 10:49
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@tommai78101
tommai78101 / unicode.c
Last active May 5, 2024 10:47
UTF-8 to UTF-16 one-way conversion, written in C
#include <stdio.h>
#include <stdlib.h>
#include <uchar.h>
#include <locale.h>
#define __STD_UTF_16__
//Pointer arrays must always include the array size, because pointers do not know about the size of the supposed array size.
void utf8_to_utf16(unsigned char* const utf8_str, int utf8_str_size, char16_t* utf16_str_output, int utf16_str_output_size) {
//First, grab the first byte of the UTF-8 string
@devzakir
devzakir / app.js
Created March 24, 2021 15:34
vuejs navigation guard
// check authentication
let auth = localStorage.getItem("auth");
if(auth){
store.dispatch('authUser').then(() => {
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
@adeleinr
adeleinr / Python Cheatsheet
Last active May 5, 2024 10:39
Python Cheetcheat
SORTING
=======
Returns a sorted list => sorted(l)
Sort in place ==> l.sort([2,3,7])
# Reverse sorting by y in an (x,y) tuple list in
sorted([(1,2),(2,3)], key=lambda tup: tup[0],reverse=True))
sample = [('Jack', 76), ('Beneth', 78), ('Cirus', 77), ('Faiz', 79)]
sample.sort(key=lambda a: a[1])
@devzakir
devzakir / auth.js
Created March 24, 2021 15:37
Vuex Store Action Example
import axios from 'axios'
import router from '../router'
export default {
namespaced: true,
state: {
authenticated: false,
user: null
},
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active May 5, 2024 10:36
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@wojteklu
wojteklu / clean_code.md
Last active May 5, 2024 10:35
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 5, 2024 10:30
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example