Skip to content

Instantly share code, notes, and snippets.

View razzul's full-sized avatar
🏠
Working from home

Razzul razzul

🏠
Working from home
View GitHub Profile
@razzul
razzul / array-sort.md
Created January 20, 2017 08:33
JavaScript : Sort array ascending | descend

By default the sort method sorts elements alphabetically.
To sort numerically just add a new method which handles numeric sorts

	var points = [40, 100, 1, 5, 25, 10];
	points.sort();
	// [1, 10, 100, 25, 40, 5]
	points.sort(function(a, b){return a-b})
	// [1, 5, 10, 25, 40, 100]
	points.sort(function(a, b){return b-a})
@razzul
razzul / redis-windows-config.md
Last active June 21, 2023 12:11
Redis : windows configuration

1. Download the redis-latest or redis-latest.zip native 64bit Windows port of redis

wget https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip

2. Extract redis64-latest.zip in any folder, e.g. in c:\redis

3. Run the redis-server.exe using the local configuration

cd c:\redis

redis-server.exe redis.windows.conf

@razzul
razzul / full-text-search.md
Created January 11, 2017 11:19
MySQL : Full text search

Col : comment
Searching string : 294
Exclude : 100

SELECT * FROM 
    `tbl_business_review` 
WHERE 
    MATCH(comment) 
 AGAINST('+294 -100' IN BOOLEAN MODE)