< /iframe> Views: 33
How do Remove Element From an Array – Simple
/** Set – New Array */ const users = []; /** * Add – New Element/Item */ users.push({ id: socket.id, name: ‘Visitor’}); /** * Find – Index of Element */ var foundIndex = users.findIndex(x => x.id == socket.id); /** * Update/Add – New Data an Founded Element */ users[foundIndex].name = data.name; /** * Remove */ users.splice(foundeIndex, 1); Example from My Home Hobby Project: const users = []; nsp.on(‘connection’, (socket) => { console.log(‘Kullanici :’ + socket.id + ‘Baglandi’); users.push({ id: socket.id, name: ‘Visitor’}); socket.on(‘sendUserData’, (data) => { console.log(‘Server => ‘ + data.name + ‘ Connected.’); var foundIndex = users.findIndex(x => x.id […]
My Experiences with Laravel 5.5
First Project / Look : I have had some experience in module writing my company software solution for an Aid Organization. This project was with Laravel 5.1, what the customer wants as a correction or update… What have I had? First of all, some pre-installed plugins(from the old developer at company) need to be updated, because these plugins work not nicely or stable.. But isn’t possible, because XYZ Plugin needed higher version another ABC, DEF Plugins, this plugin needed higher version of laravel/framework. If I framework updated, then you get several errors, because main core functions or classes changed or […]
Raspberry Pi Zero W + USB Modem – SMS Gateway
This Article updated on 08.09.2019 Install usb-modeswitch, smstools, wvdial sudo apt-get install usb-modeswitch usb-modeswitch-data smstools wvdial Find right device and baudrate with this command; sudo wvdialconf …my modem information (modem on ttyUSB1 and baudrate 9600)… ttyUSB0<*1>: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud ttyUSB0<*1>: ATQ0 V1 E1 — failed with 9600 baud, next try: 9600 baud ttyUSB0<*1>: ATQ0 V1 E1 — and failed too at 115200, giving up. ttyUSB1<*1>: ATQ0 V1 E1 — OK ttyUSB1<*1>: ATQ0 V1 E1 Z — OK ttyUSB1<*1>: ATQ0 V1 E1 S0=0 — ERROR ttyUSB1<*1>: ATQ0 V1 E1 &C1 — ERROR […]
Raspbian Stretch Lite – Setup (Raspberry Pi Zero W)
Stretch Lite image Download Link: https://www.raspberrypi.org/downloads/raspbian/ Choose Raspbian Stretch Lite Download ZIP. Make unzip this downloaded zip file. The easiesst way to Flash to your SD Card is Etcher. Download and install this Software. After Openning, Select .iso file, and your SD Card and click Flash. How to set up WiFi Create a file in Boot directory called wpa_supplicant.conf ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev network={ ssid=”YOUR-NETWORK-NAME” psk=”PASSWORD” key_mgmt=WPA-PSK } How to enable SSH Create a file in Boot directory empty file called ssh. For example i have on my computer Git Bash Terminal, with this Terminal type only this command: touch ssh or second […]