Skip to content

Instantly share code, notes, and snippets.

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

arun.jayapal deostroll

😄
indeed...!
View GitHub Profile
@jctosta
jctosta / init_postgres_windows.md
Last active April 8, 2024 04:23
A simple guide on initializing the Windows version of Postgres using the zip file instead of msi installer
@XMB5
XMB5 / irconvert.js
Last active March 5, 2024 16:51
Convert from infrared pronto codes to raw codes
//usage: node irconvert.js <pronto hex>
//steps from https://stackoverflow.com/a/27323452
numbers=process.argv[2].split(' ').map(x=>parseInt(x,16))
fullSequenceConverted=[]
carrierFrequency = 1000000/(numbers[1] * .241246)
codeLength = numbers[2]
repeatCodeLength = numbers[3]
for(i=4;i<numbers.length;i++) {
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active April 23, 2024 21:05
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@kevprice83
kevprice83 / swagger.json
Created March 22, 2017 11:52
Petstore Swagger spec
{
"swagger": "2.0",
"schemes": [
"http",
"https"
],
"host": "petstore.swagger.io",
"basePath": "/v2",
"info": {
"description": "This is a sample server Petstore server.\nYou can find out more about Swagger at\n[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nFor this sample, you can use the api key `special-key` to test the authorization filters.\n# Introduction\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Rebilly/ReDoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md).\n# OpenAPI Specification\nThis API is documented in **Open
@deostroll
deostroll / script.txt
Created October 19, 2016 16:18
blogger mathjax script
<script type="text/javascript">!function(){if(!("MathJax"in window||document.getElementById("mathjax"))){var a=document.createElement("script");a.id="mathjax",a.src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML",a.onload=function(){MathJax.Hub.Config({tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}})},document.body.appendChild(a)}}();</script>
@subfuzion
subfuzion / tracing-with-pegjs.md
Last active March 6, 2021 12:56
Tracing with peg.js

PEG.js is a simple parser generator for JavaScript that produces fast parsers with excellent error reporting. You can use it to process complex data or computer languages and build transformers, interpreters, compilers and other tools easily.

PEG.js offers tracing support to help analyze parser issues with a grammar. The feature is very helpful, but it's not available yet on the version that's published to npm, it's not well-advertised, and not well-documented. This gist explains how to take advantage of PEG.js tracing support.

When you generate your parser, make sure you supply the trace option set to true. If using gulp, do something like this:

var peg = require('gulp-peg');

var paths = {
@jvshahid
jvshahid / terminate.cs
Last active February 18, 2024 02:23
C# terminating a child process (as opposed to killing, i.e. sigkill vs. sigint on linux)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace TestCtrlEvent
@utinajerolps
utinajerolps / scrabble_score.py
Created September 11, 2014 20:33
scrabble_score
score = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2,
"f": 4, "i": 1, "h": 4, "k": 5, "j": 8, "m": 3,
"l": 1, "o": 1, "n": 1, "q": 10, "p": 3, "s": 1,
"r": 1, "u": 1, "t": 1, "w": 4, "v": 4, "y": 4,
"x": 8, "z": 10}
def scrabble_score(word):
word = str(word).lower()
total = 0
for letters in word:
@TemporaryJam
TemporaryJam / Howto convert a PFX to a seperate .key & .crt file
Last active April 4, 2024 10:52
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@sudodoki
sudodoki / sharedWorker.js
Created August 10, 2013 11:43
Shared worker demo: proof of concept that different tabs can exchange messages using SharedWorker (so far isn't that spread (caniuse.com/#feat=sharedworkers)[http://caniuse.com/#feat=sharedworkers]
var clients = new Array();
clients.length = 0;
var broadcast = function(clients, message) {
var length = clients.length,
element = null;
for (var i = 0; i < length; i++) {
port = clients[i];
port.postMessage(message);
}