Skip to content

Instantly share code, notes, and snippets.

View islahh's full-sized avatar

Islah Mohammad Musleh islahh

  • Forest Interactive
  • Kuala Lumpur Malaysia
  • 10:20 (UTC -12:00)
View GitHub Profile
@islahh
islahh / cmd.sh
Created December 30, 2021 04:29 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@islahh
islahh / queue.js
Created September 27, 2020 04:31 — forked from deleteman/queue.js
class Queue {
data = []
maxSize
constructor(initialData, maxSize = -1) {
this.data = Array.isArray(initialData) ? initialData : (typeof initialData == "undefined" ? [] : [initialData])
this.maxSize = maxSize
}
isFull() {
@islahh
islahh / url-segment.js
Created September 22, 2020 07:20 — forked from jserrao/url-segment.js
Get Last Segment of a URL in Javascript
var pageURL = window.location.href;
var lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
console.log(lastURLSegment);
@islahh
islahh / lumen_in_subfolder.md
Created September 22, 2020 04:40 — forked from dbaeck/lumen_in_subfolder.md
Howto deploy Lumen projects within a subfolder (on a shared hoster)

Howto deploy Lumen projects within a subfolder (on a shared hoster)

For Lumen (5.0.8) (Laravel Components 5.0.*)

Use Case: Deploying Lumen App to Shared Hoster such that it can be called via domain.tld/lumenapp/...

Folder Layout

  • Rename public to desired name (new root folder, for example lumenapp)
  • Move everything else into a new folder, named e.g. project_src