Skip to content

Instantly share code, notes, and snippets.

View aaayushsingh's full-sized avatar

Ayush Singh aaayushsingh

View GitHub Profile
declare var AWSAppSyncClientVersionNumber: number;
declare var AWSAppSyncClientVersionString: interop.Reference<number>;
declare var AWSAppSyncVersionNumber: number;
declare var AWSAppSyncVersionString: interop.Reference<number>;
declare class AWSIoTMQTTClient<AWSSRWebSocketDelegate, NSStreamDelegate> extends NSObject {
"use strict";
/*
* Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
/*******************************************************************************
* Copyright (c) 2013 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
@aaayushsingh
aaayushsingh / README.md
Last active August 7, 2018 22:30
Setup a nodejs or any such process on a webserver and make it accessible using nginx.

Setup a nodejs or any such process on a webserver and make it accessible using nginx.


This does not use pm2 module, but uses bg process instead.

1. Install nodejs

for debian and ubuntu based distros, do the following.

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
@aaayushsingh
aaayushsingh / split.java
Created December 9, 2017 04:27
stringSplit
public class JavaApplication15 {
/**
* @param args the command line arguments
*/
static String input = "I am testing an string split program here and there is some problem";
public static void main(String[] args) {
// TODO code application logic here
input += " dummyinputtohackresult";
function whatsAppText(t) {
window.InputEvent = window.Event || window.InputEvent;
var d = new Date();
var event = new InputEvent('input', {bubbles: true});
var textbox = document.querySelector('#main > footer > div.block-compose > div.input-container > div.pluggable-input.pluggable-input-compose > div.pluggable-input-body.copyable-text.selectable-text');
textbox.textContent = t;
textbox.dispatchEvent(event);
import csv
filen = 'full-corpus.csv'
with open(filen) as csv_file:
reader = csv.reader(csv_file, delimiter=',', quotechar='"')
for item in reader:
print(item[0])
@aaayushsingh
aaayushsingh / programs.c
Last active September 17, 2017 11:00
c programs vishal
//Program 1, to reverse strings.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) //used to accept command line args
{
if(argc < 2 ){ //check if there are any inputs in command line
printf("please provide inputs"); //if no, exit
exit(1);
@aaayushsingh
aaayushsingh / BluetoothLEFindActivity.java
Created August 21, 2017 05:08
new, checks permissions
package com.sunflyelec.smartearphone.module.bluetooth.activity;
import android.Manifest;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;