Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Arjun Komath arjunkomath

:octocat:
View GitHub Profile
@arjunkomath
arjunkomath / ghost-comments.js
Created Nov 26, 2022
Setup comments in ghost blog
View ghost-comments.js
<script>
try {
let commentsContainerSelector = ".gh-content";
if (document.querySelector(commentsContainerSelector)) {
const commentsEl = document.createElement("script");
commentsEl.src = "https://utteranc.es/client.js";
commentsEl.setAttribute("repo", "github-username/repo-name");
commentsEl.setAttribute("issue-term", "pathname");
commentsEl.setAttribute("theme", "preferred-color-scheme");
commentsEl.setAttribute("crossorigin", "anonymous");
@arjunkomath
arjunkomath / dark.css
Last active Oct 24, 2022
Dark mode styles for Ghost Solo theme
View dark.css
@media (prefers-color-scheme: dark) {
:root {
--background-color: #1a1a1a;
--color-primary-text: #e3e3e3;
--color-secondary-text-dark: rgba(255, 255, 255, 0.65);
--color-secondary-text-light: rgba(0, 0, 0, 0.8);
--color-secondary-text: var(--color-secondary-text-dark);
--color-darker-gray: #e1e1e1;
--color-lighter-gray: #000;
--color-border: rgba(255, 255, 255, 0.08);
View grafana.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: grafana
namespace: monitoring
spec:
replicas: 1
template:
metadata:
labels:
@arjunkomath
arjunkomath / push.java
Last active Jan 2, 2022
Push by Techulus
View push.java
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.junit.Test;
import java.io.IOException;
import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
@arjunkomath
arjunkomath / browser.js
Created Sep 9, 2018
Browser by Techulus
View browser.js
const express = require('express');
const puppeteer = require('puppeteer');
const app = express();
app.get('/image', async (req, res) => {
let browser = null;
if (process.env.NODE_ENV === 'production') {
browser = await puppeteer.connect({ browserWSEndpoint: 'wss://chrome.browser.techulus.com?API_KEY=YOUR_API_KEY' })
} else {
View test.js
angular.module('test', ['ngSanitize'])
.filter('addTargetBlank', function(){
return function(x) {
var tree = angular.element('<div>'+x+'</div>');
for(var i=0;i < tree.find('a').length;i++){
if (tree.find('a')[i].href.indexOf(window.location.hostname) == -1) {
tree.find('a')[i].setAttribute('target', '_blank');
}
}
@arjunkomath
arjunkomath / cloudSettings
Last active May 8, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-05-08T09:25:36.710Z","extensionVersion":"v3.4.3"}
View capture.js
// Include https://github.com/blueimp/JavaScript-MD5
var API_URL = 'https://api.capture.techulus.in/';
var your_api_key = 'API_KEY_FROM_CONSOLE';
var your_api_secret = 'API_SECRET_FROM_CONSOLE'
// Target URL
var input_url = encodeURIComponent('http://techulus.in/');
var hash = md5(your_api_secret + 'url=' + input_url);