Skip to content

Instantly share code, notes, and snippets.

View arjunkomath's full-sized avatar
👋

Arjun Komath arjunkomath

👋
View GitHub Profile
@arjunkomath
arjunkomath / schema.ts
Last active July 8, 2023 21:52
Debug Drizzle
// User table
export const user = sqliteTable(
"User",
{
id: text("id").primaryKey().notNull(),
email: text("email").notNull(),
createdAt: integer("createdAt", { mode: "timestamp" }).notNull(),
updatedAt: integer("updatedAt", { mode: "timestamp" }).notNull(),
},
(table) => {
@arjunkomath
arjunkomath / ghost-comments.js
Created November 26, 2022 01:27
Setup comments in ghost blog
<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 October 24, 2022 23:15
Dark mode styles for Ghost Solo theme
@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);
@arjunkomath
arjunkomath / push.java
Last active January 2, 2022 00:44
Push by Techulus
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 / cloudSettings
Last active May 8, 2020 09:25
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-08T09:25:36.710Z","extensionVersion":"v3.4.3"}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: grafana
namespace: monitoring
spec:
replicas: 1
template:
metadata:
labels:
@arjunkomath
arjunkomath / browser.js
Created September 9, 2018 16:25
Browser by Techulus
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 {
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 / capture.js
Last active August 31, 2018 06:40
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);