Skip to content

Instantly share code, notes, and snippets.

View tk120404's full-sized avatar
🎯
Focusing

Arjunkumar tk120404

🎯
Focusing
View GitHub Profile
@curran
curran / INDIA_DISTRICTS_TOPO.json
Last active February 26, 2024 10:50
India Geometries
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aescarcha
aescarcha / nodeAsyncTest.js
Created September 25, 2018 07:03
Javascript async / await resolving promises at the same time test
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, time);
});
}
@geoffleyland
geoffleyland / ortools_vrp_4_depots_14_stops.cpp
Last active February 7, 2019 08:45
Ortools RoutingModel not finding best solution to a VRP in a 14-node example
#include "or_tools_route.h"
#include "ortools/constraint_solver/routing.h"
#include <vector>
#include <cstdio>
using operations_research::RoutingModel;
#define DEPOT_COUNT 4#include "or_tools_route.h"
#include "ortools/constraint_solver/routing.h"
@uorat
uorat / nginx-websocket-proxy.conf
Last active February 11, 2023 16:04
Nginx Reverse Proxy for WebSocket
upstream websocket {
server localhost:3000;
}
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/websocket.access.log main;
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/j/vendor/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/j/vendor/underscore-min.js"></script>
<script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/latest/clappr.min.js"></script>
<script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/bemtv/alpha/p2phls.min.js"></script>
<script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/bemtv/latest/p2phlsstats.min.js"></script>
<title>Globo Media Control Test Page</title>
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@demisx
demisx / angularjs-providers-explained.md
Last active March 17, 2024 11:09
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@tk120404
tk120404 / india.js
Last active October 4, 2016 13:23
Prints India Map as shown below in the india.txt node india.js
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
@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example: