Skip to content

Instantly share code, notes, and snippets.

View deostroll's full-sized avatar
😄
indeed...!

arun.jayapal deostroll

😄
indeed...!
View GitHub Profile
@deostroll
deostroll / dateformatting
Last active July 21, 2021 11:48 — forked from DevelopKim/dateformatting
javascript date formatting
var today = new Date();
function fmtDate(today) {
return `${today.getFullYear()}${('0' + (today.getMonth() + 1)).slice(-2)}${('0' + today.getDate()).slice(-2)}-${('0' + today.getHours()).slice(-2)}_${('0' + today.getMinutes()).slice(-2)}_${('0' + today.getSeconds()).slice(-2)}`;
}
fmtDate(today);
//ex . Wed Aug 28 2013 17:50:28 GMT+0900 (KST) -> "20130828_17-50-28"
@deostroll
deostroll / x11vnc_server_on_startup.md
Last active September 20, 2020 11:00 — forked from YourFriendCaspian/x11vnc_server_on_startup.txt
Configure your system to have x11vnc running at startup.

Ubuntu 15.04 – Configure your system to have x11vnc running at startup.

Hello World,

If you are following us, you probably remember that we wrote already a post about this topic (see Ubuntu 14.10 – Configure your sytem to have x11vnc running at startup). Since Ubuntu 15.04 is using systemd, the instructions found in the previous post are not applicable anymore. Some of our readers had issues after upgrading to Ubuntu 15.04. The x11VNC is not running at startup anymore.

@deostroll
deostroll / .eslintrc
Created June 22, 2017 17:43 — forked from Javiani/.eslintrc
.eslintrc
{
"rules": {
"indent": [2,"tab"],
"quotes": [2,"single"],
"linebreak-style": [2,"unix"],
"semi": [2,"never"],
"no-unused-vars": ["error", { "vars": "all", "args": "none" }]
},
"env": {
"es6": true,
@deostroll
deostroll / Inject VelocityJS
Last active April 12, 2017 15:54 — forked from painteddigital/Inject VelocityJS
Paste this into your console to play with velocity on a page that doesn't have it. It assumes jQuery exists already
(function() {
var url = ['cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js'];
for(var i=0; i < url.length; i++){
var v = document.createElement('script'); v.type = 'text/javascript'; v.async = true;
v.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + url[i];
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(v, s);
}
})();
@deostroll
deostroll / test.js
Created December 4, 2015 11:15 — forked from bennadel/test.js
Turning Buffers Into Readable Streams In Node.js
// Required module references.
var stream = require( "stream" );
var chalk = require( "chalk" );
var util = require( "util" );
var http = require( "http" );
var fileSystem = require( "fs" );
// ---------------------------------------------------------- //
// ---------------------------------------------------------- //
@deostroll
deostroll / comb.py
Last active August 29, 2015 14:16 — forked from anonymous/comb.py
Combinations in python using a generator
from math import factorial as fact
def comb(seq, r):
n = len(seq)
total = fact(n) / (fact(r) * fact(n-r))
pos = range(r)
#c= []
i = 0
while i < total:
#c.append(map(lambda x: seq[x], pos))
@deostroll
deostroll / comb.py
Last active August 29, 2015 14:16 — forked from anonymous/comb.py
Simple combinations using python
from math import factorial as fact
def comb(seq, r):
n = len(seq)
total = fact(n) / (fact(r) * fact(n-r))
pos = range(r)
c= []
i = 0
while i < total:
c.append(map(lambda x: seq[x], pos))