Skip to content

Instantly share code, notes, and snippets.

View xuboso's full-sized avatar
🤒
Out sick

Sachi xuboso

🤒
Out sick
View GitHub Profile
@xuboso
xuboso / learn.md
Created May 12, 2024 06:03 — forked from rylev/learn.md
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@xuboso
xuboso / docker-compose.yml
Created October 18, 2020 02:32
build php development environment use docker compose
version: '2'
services:
web:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./code:/code
- ./site.conf:/etc/nginx/conf.d/default.conf
@xuboso
xuboso / go_build.MD
Last active September 25, 2019 12:02
GO编译生成可执行文件
package main
import "net/http"
func main() {
fs := http.FileServer(http.Dir("downloads/"))
http.Handle("/static/", http.StripPrefix("/static/", fs))
http.ListenAndServe(":8081", nil)
}
@xuboso
xuboso / .vimrc1
Created March 30, 2017 23:53
vim配置
syntax on
set expandtab
set sw=4
set sts=4
set autoindent
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
@xuboso
xuboso / deploy.sh
Created August 27, 2016 03:29
symfony deploy script
#!/bin/bash
echo "[pull code] update code from bitbucket repository"
git pull origin master
echo "[composer install] check package to install"
composer install --no-dev --optimize-autoloader
echo "[validate doctrine schema]"
php app/console doctrine:schema:validate
@xuboso
xuboso / KeyGenerateCommand.php
Created January 28, 2016 10:14 — forked from krisanalfa/KeyGenerateCommand.php
Lumen Key Generator Commands
<?php namespace App\Console\Commands;
use Illuminate\Support\Str;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
class KeyGenerateCommand extends Command
{
/**
* The console command name.
#############################################################################
# current prompt
#############################################################################
# \d – Current date
# \t – Current time
# \h – Host name
# \# – Command number
# \u – User name
# \W – Current working directory (ie: Desktop/)
# \w – Current working directory, full path (ie: /Users/Admin/Desktop)
@xuboso
xuboso / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
namespace App\Security;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;