Skip to content

Instantly share code, notes, and snippets.

How to install Laravel globally in Ubuntu

===================================================================

Open your terminal using Ctrl+Alt+T and type the following commands

Step 1: Install Laravel

composer global require "laravel/installer"
@jboner
jboner / latency.txt
Last active May 12, 2024 07:29
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
Simple java program to read from files using FileReader
- reading from a file using FileReader
```java
File file=null;
FileReader fileReader=null;
StringBuilder sb=new StringBuilder();
try {
file = new File("src/main/java/com/vksviit/patterns/factorydesignpattern/streaming/sample.txt");
@RednibCoding
RednibCoding / Create a static library of a .c file.md
Last active May 12, 2024 07:25
Create a static library of a .c file for windows and linux

How do i create a static library file of my test.c with gcc?

You can create a static library .lib file using the GCC compiler by following these steps:

  1. Compile the source files into object files:
gcc -c test.c
@rvrsh3ll
rvrsh3ll / windows-keys.md
Created February 18, 2024 22:44
Windows Product Keys

NOTE

These are NOT product / license keys that are valid for Windows activation.
These keys only select the edition of Windows to install during setup, but they do not activate or license the installation.

Index

@whunter
whunter / adb_rotation.sh
Created February 9, 2016 18:13
android device display rotation via adb
# disable auto rotation
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
# force landscape
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
# back to portrait
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0
# upside down
@tomoaki0705
tomoaki0705 / text.md
Last active May 12, 2024 07:20
「OpenCVの画像処理をGPU(CUDA)で高速化する」を読んでresizeをマルチコア対応するお話。

はじめに

OpenCVでの処理(リサイズなど)を、簡単にマルチコア化する方法をどなたかご存知でしたら教えて頂けないでしょうか? TBBを使ってスレッドを作る方法は色々見つかったのですが、単にcv::resize()をマルチコア動作で高速化させたいです。

TL;DR

  • Python バインディングが遅い
  • OpenCV の resize はずっと昔からマルチコア対応している
@Bilka2
Bilka2 / webhook.py
Last active May 12, 2024 07:17
Simple discord webhook with python
import requests # dependency
url = "<your url>" # webhook url, from here: https://i.imgur.com/f9XnAew.png
# for all params, see https://discordapp.com/developers/docs/resources/webhook#execute-webhook
data = {
"content" : "message content",
"username" : "custom username"
}
@sundowndev
sundowndev / GoogleDorking.md
Last active May 12, 2024 07:15
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"