Skip to content

Instantly share code, notes, and snippets.

View rahulmr's full-sized avatar
🏠
Working from home

Rahul Raut rahulmr

🏠
Working from home
View GitHub Profile
// import_json_appsscript.js
// https://gist.github.com/allenyllee/c764c86ed722417948fc256b7a5077c4
//
// Changelog:
// (Oct. 16 2019) tag: allenyllee-20191016
// 1. Fixed google script error: urlfetchapp - service invoked too many times https://stackoverflow.com/questions/10598179/google-apps-script-urlfetchapp-service-invoked-too-many-times
// (Jul. 16 2018) tag: allenyllee-20180716
// 1. Fixed the issue "If you try to query /arrayA[k]/arrayB[n]/arrayC[m]/.../member, you will always get /arrayA[k]/arrayB[k]/arrayC[k]/.../member."
// (Nov. 30 2017) tag: allenyllee-20171130
// 1. Add the ability to query array elements by using xpath like "/array[n]/member" where "n" is array index
@khiemdoan
khiemdoan / install_microk8s.sh
Last active September 30, 2023 21:53
Install Microk8s on Ubuntu machine
# Install microk8s from the edge channel (Rancher requires Helm 2.15.1 or above)
sudo snap install microk8s --classic
# Enable useful plugins
sudo microk8s.enable dns dashboard storage ingress helm
# Allow running priviledged Pods (required by Rancher's `cattle-node-agent`)
sudo sh -c 'echo "--allow-privileged=true" >> /var/snap/microk8s/current/args/kube-apiserver'
sudo systemctl restart snap.microk8s.daemon-apiserver.service
# Setup and install Tiller (part of Helm)
# [PackageDev] target_format: plist, ext: tmLanguage
name: AutoIt Script
scopeName: source.autoit
fileTypes: [au3]
uuid: E4862A3B-FBD6-342C-AB07-4EE2567CF68B
patterns:
- name: keyword.control.autoit
match: \b(?i:byref|case|const|continuecase|continueloop|default|dim|do|else|elseif|endfunc|endif|endselect|endswitch|endwith|enum|exit|exitloop|false|for|func|global|if|in|local|next|redim|return|select|step|switch|then|to|true|until|wend|while|with)\b
@ajinasokan
ajinasokan / kitetickersample.html
Last active December 18, 2023 18:47
Kite Ticker Pure JS Example
<script src="ticker.js"></script>
<script>
var ticker = new KiteTicker({api_key: "api_key", access_token: "access_token"});
ticker.connect();
ticker.on("ticks", onTicks);
ticker.on("connect", subscribe);
function onTicks(ticks) {
image: node:10.15.0
test: &test
name: Install and Test
script:
- cd my-tools
- npm install
- npm test
- npm pack
artifacts: # defining the artifacts to be passed to each future step.
# - dist/**
@cabrerahector
cabrerahector / bitbucket-pipelines.yml
Last active January 24, 2024 14:17
Bitbucket Pipelines - Deploying to Server with atlassian/ftp-deploy with Manual Triggers
image: atlassian/default-image:2
pipelines:
custom:
deploy-to-production:
- step:
name: Deploy to Production
deployment: production
script:
@ovichiro
ovichiro / tomcat-linux.service.md
Last active February 2, 2024 03:20
Tomcat as a service on Linux

Install Tomcat as a service on Linux

Download Tomcat from the Apache website.
Unpack in /opt/apache-tomcat-x.y.z. E.g. /opt/apache-tomcat-8.5.6.
You'll need a terminal and root access.

Create Tomcat user with restricted permissions

@joeshaw
joeshaw / proxy_views.py
Created September 20, 2011 17:47
super-hacky flask proxy
# coding:utf-8
# Copyright 2011 litl, LLC. All Rights Reserved.
import httplib
import re
import urllib
import urlparse
from flask import Blueprint, request, Response, url_for
from werkzeug.datastructures import Headers
@Stanback
Stanback / nginx.conf
Last active April 22, 2024 19:23 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@byt3bl33d3r
byt3bl33d3r / ws.ps1
Last active April 23, 2024 15:33
Async Websocket PowerShell client (producer/consumer pattern)
<#
References:
- https://docs.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocket?view=netframework-4.5
- https://github.com/poshbotio/PoshBot/blob/master/PoshBot/Implementations/Slack/SlackConnection.ps1
- https://www.leeholmes.com/blog/2018/09/05/producer-consumer-parallelism-in-powershell/
#>
$client_id = [System.GUID]::NewGuid()
$recv_queue = New-Object 'System.Collections.Concurrent.ConcurrentQueue[String]'