Skip to content

Instantly share code, notes, and snippets.

View itswadesh's full-sized avatar

Swadesh Behera itswadesh

View GitHub Profile
@itswadesh
itswadesh / myFriends.js
Created April 30, 2022 09:28
List of accepted friends
const query = [
{
$lookup: {
from: 'friends',
localField: '_id',
foreignField: 'userId',
as: 'friends',
},
},
{
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>AngularJS Authentication App</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<?php
class Database {
private $host = "localhost";
private $user = "root";
private $password = "root";
private $database = "crud";
function runQuery($sql) {
$conn = new mysqli($this->host,$this->user,$this->password,$this->database);
if ($conn->connect_error) {
@itswadesh
itswadesh / textlocal.js
Created December 17, 2016 14:21
Send sms using NodeJS from India (https://www.textlocal.in/)
var http = require('http');
var urlencode = require('urlencode');
var msg = urlencode('hello js');
var toNumber = 'TO_PHONE_NO';
var username = 'TEXTLOCAL_USER_EMAIL';
var hash = 'TEXTLOCAL_USER_HASH'; // The hash key could be found under Help->All Documentation->Your hash key. Alternatively you can use your Textlocal password in plain text.
var sender = 'txtlcl';
var data = 'username=' + username + '&hash=' + hash + '&sender=' + sender + '&numbers=' + toNumber + '&message=' + msg;
var options = {
host: 'api.textlocal.in', path: '/send?' + data
{"lastUpload":"2020-09-16T07:58:25.777Z","extensionVersion":"v3.4.3"}
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <FirebaseArduino.h>
#define FIREBASE_HOST "example.firebaseio.com" // optional
#define FIREBASE_AUTH "token_or_secret" // optional
#define WIFI_SSID "Wifi_Name"
#define WIFI_PASSWORD "Wifi_Password"
'use strict';
angular.module('appointmentApp', ['ngMaterial'])
var app = angular.module('myApp', ['ngRoute']);
app.factory("services", ['$http', function($http) {
var serviceBase = 'services/'
var obj = {};
obj.getCustomers = function(){
return $http.get(serviceBase + 'customers');
}
obj.getCustomer = function(customerID){
return $http.get(serviceBase + 'customer?id=' + customerID);
}
<?php
require_once '../includes/db.php'; // The mysql database connection script
if(isset($_GET['taskID'])){
$status = $_GET['status'];
$taskID = $_GET['taskID'];
$query="update tasks set status='$status' where id='$taskID'";
$result = $mysqli->query($query) or die($mysqli->error.__LINE__);
$result = $mysqli->affected_rows;
<?php
require_once '../includes/db.php'; // The mysql database connection script
if(isset($_GET['taskID'])){
$taskID = $_GET['taskID'];
$query="delete from tasks where id='$taskID'";
$result = $mysqli->query($query) or die($mysqli->error.__LINE__);
$result = $mysqli->affected_rows;