Skip to content

Instantly share code, notes, and snippets.

View dileephell's full-sized avatar
🎯
Focusing

Dileep Singh dileephell

🎯
Focusing
View GitHub Profile
show collections
pageviews
products
system.indexes
test
users
>
>
> db.users.find()
{ "_id" : ObjectId("519b6c75e4b0a0a2b3e95185"), " _id" : "joe", "joined" : "2012-02-03T00:00:00Z", "likes" : [ "tennis", "golf" ] }
TypeError: Object has no method 'push'
at Object.createnewrecord (/home/dileep/Documents/erp/erp-schema/modals/mdl_vndr_myproduct.js:72:20)
at exports.newsubmit (/home/dileep/Documents/erp/erp-schema/mongo_access/vndr_fn_product.js:45:14)
at callbacks (/home/dileep/node_modules/express/lib/router/index.js:161:37)
at exports.login_check (/home/dileep/Documents/erp/erp-schema/security/check_authentication.js:10:4)
at callbacks (/home/dileep/node_modules/express/lib/router/index.js:161:37)
at param (/home/dileep/node_modules/express/lib/router/index.js:135:11)
at pass (/home/dileep/node_modules/express/lib/router/index.js:142:5)
at Router._dispatch (/home/dileep/node_modules/express/lib/router/index.js:170:5)
at Object.router (/home/dileep/node_modules/express/lib/router/index.js:33:10)
var a,b=0,c=10,qwer ="TFy!QJu ROo TNn(ROo)SLq SLq ULo+UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^NBELPeHBFHT}TnALVlBLOFAkHFOuFETpHCStHAUFAgcEAelclcn^r^r\\tZvYxXyT|S~Pn SPm SOn TNn ULo0ULo#ULo-WHq!WFs XDt!";
while ((a = qwer.charCodeAt(b++)) != 0) {
while (a-- > 64) {
require('sys').print( ++c==90 ? String.fromCharCode(c = c/ 9):String.fromCharCode(33^b&1));
}
}
//Source : http://codepad.org/ngiITeZ4
@dileephell
dileephell / gist:cab06d51ce0e88b4d449
Last active August 29, 2015 14:14
Characters Strike and Drop in the valley --Words with Enemies
Description:
I had a dream a few weeks back that I thought would be a good challenge. I woke up early and quickly typed up a text description so I wouldn't forget (Seriously, it was about 5am and when I explained it to my wife she just laughed at me)
Okay so there is a valley. On each side you got cannons. They are firing words at each other. In the middle of the valley the words would make contact and explode. Similar letters from each word would cancel out. But the left over unique letters from each word would fall to the valley and slowly fill it up.
So your challenge is to come up with the code given two words you eliminate letters in common at a ratio of 1 for 1 and produce a set of letters that are left over from each word after colliding in mid air. Which ever side has the most letters left over "wins". If each side donates an equal amount of letters it is a "tie".
Examples:
hat cat
both have an "a" and a "t". They will explode and cancel each other out so you get an "h" and a "c" left and so the answ
@dileephell
dileephell / gist:386c3f51f52891415713
Last active August 29, 2015 14:14
Quiz competition
http://jsfiddle.net/wanwu/mAcaM/light/
https://github.com/debugmodedotnet/womensafety/tree/master/SafeBridge
@dileephell
dileephell / 0.md
Created September 18, 2017 07:18 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var http = require('http');
exports.handler = (event, context,callback) => {
function getJSON(options, callback){
http.request(options, function(res){
var body = "";
console.log('calling the http');
res.on('data', function(chunk){
console.log('body' + chunk);
var express = require('express');
var session = require('express-session');
var bodyParser = require('body-parser');
var app = express();
var path = require('path');
var cors = require('cors');
app.use(cors());
// app.all('*', function(req, res, next){
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
<title>Chatbot UI iFrame Example</title>
<!-- bot css -->
<link rel="stylesheet" type="text/css" href="./chatbot-ui-iframe-loader.css">
<!-- bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">