Skip to content

Instantly share code, notes, and snippets.

View san-kumar's full-sized avatar
😀
All we had to do, was follow the damn train, CJ!

San Kumar san-kumar

😀
All we had to do, was follow the damn train, CJ!
View GitHub Profile
@san-kumar
san-kumar / gist:b3604ca40905556b4135fee64ead58f2
Last active January 30, 2024 03:17
tampermonkey script to show summaries on hacker news
// ==UserScript==
// @name hn summary (kagi)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://news.ycombinator.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=ycombinator.com
// @grant GM_xmlhttpRequest
// @require https://code.jquery.com/jquery-3.4.1.min.js
@san-kumar
san-kumar / gist:f7cf0cec5af4388cd8f4a77fd7411c2c
Created June 9, 2023 18:11
tampermonkey script to show summaries on hacker news
// ==UserScript==
// @name hn summary (kagi)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://news.ycombinator.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=ycombinator.com
// @grant GM_xmlhttpRequest
// @require https://code.jquery.com/jquery-3.4.1.min.js
describe('My First Test', function() {
it('Check if popup loads properly', function() {
cy.visit('https://www.uploader.win');
cy.contains('Open Uploader').click();
cy.get('iframe').then($iframe => {
const $body = $iframe.contents().find('body');
cy.wrap($body).find('#sidebar');
@san-kumar
san-kumar / namecheap.js
Created July 7, 2018 18:47
namecheap list domain names by price
r = jQuery('li.register').each(function() {
let e = jQuery(this);
let v = parseFloat(e.find('.domain-dollar-value').text().replace(/[^0-9\.]/g, ''));
if(v>0&&v<200){
console.log(e.find('span.domain-name').text(), v);
}
});
@san-kumar
san-kumar / stories.php
Created February 23, 2018 17:38
sort stories.json
<?php
$data = json_decode(file_get_contents('c:/tmp/stories.json'), true);
$map = ['year', 'created_at', 'title', 'url', 'points', 'author', 'num_comments'];
$file_input = fopen("stories.csv", "w");
fputcsv($file_input, $map);
foreach($data as $year => $stories) {
foreach($stories as $story) {