Skip to content

Instantly share code, notes, and snippets.

@ankit
ankit / tsdx.config.js
Created January 5, 2021 01:42
Custom tsdx.config.js to support @zerollup/ts-transform-paths and ttypescript
// https://github.com/zerkalica/zerollup/tree/master/packages/ts-transform-paths
const ttypescript = require('ttypescript');
const typescript = require('rollup-plugin-typescript2');
module.exports = {
rollup(config, options) {
const rpt2Plugin = config.plugins.find(p => p.name === 'rpt2');
const rpt2PluginIndex = config.plugins.indexOf(rpt2Plugin);
const tsconfigPath = options.tsconfig || 'tsconfig.json';
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
@ankit
ankit / .gitconfig
Created January 19, 2012 05:35
My ~/.gitconfig
# ~/.gitconfig
# credits: https://gist.github.com/1637874
[alias]
s = status
df = diff --color-words
co = checkout
cm = commit -am
l = log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort
[core]
@ankit
ankit / wp-code-hacks.php
Created May 7, 2011 18:10
Enabling editing Wordpress pages using Textmate Blogging Bundle
/*** Edits to wp-includes/post.php ***/
// Add this method
//
function wp_get_pages( $args = array(), $output = ARRAY_A ) {
if ( is_numeric( $args ) ) {
_deprecated_argument( __FUNCTION__, '3.1', __( 'Passing an integer number of posts is deprecated. Pass an array of arguments instead.' ) );
$args = array( 'numberposts' => absint( $args ) );
}
@ankit
ankit / newTwitterOpenLinkShortcut.user.js
Created October 3, 2010 13:18
Userscript to add 'o' shortcut to the new Twitter. Opens shared links, @reply usernames, hashtags shared in a tweet, in that order of priority
// ==UserScript==
// @name 'o' shortcut for new Twitter
// @description Adds an 'o' shortcut to open any shared links in selected tweet in a new tab in the background. If no link is found, looks for @usernames. And finally if no usernames, looks for hashtags.
// @include http://twitter.com/*
// @author Ankit Ahuja
// ==/UserScript==
// DISCLAIMER: Only tested on Chrome!
document.addEventListener('keyup', function(e) {
@ankit
ankit / merriam-webster.css
Created October 1, 2010 13:48
Custom CSS for merriam-webster.com
input.search-button {
display: none;
}
#myDynamicContent {
display: none;
}
#adaptvDiv {
display: none;
@ankit
ankit / stackoverflow.css
Created September 29, 2010 11:45
Custom CSS for prettifying Stack Overflow. Also, hides notifications, onhover boxes for tags
#notify--1 {
display: none;
}
#notify-2 {
display: none;
}
#notify-container {
display: none;
@ankit
ankit / MyDictionaryReferenceCSS.css
Created September 20, 2010 09:22
Custom CSS for dictionary.reference.com
#bnrTop object {
display: none;
}
#skyAd a img {
display: none;
}
#centerAd object {
display: none;
@ankit
ankit / HackerNewsMain.css
Created September 20, 2010 08:39
Custom CSS for Hacker News. Some additions on top of original styling by sam33r
/*
For news.ycombinator.com
*/
td.title {
padding-top: 20px;
color: #f0f0f0;
}
body {
@ankit
ankit / mnemonic_dictionary.css
Created September 7, 2010 06:26
Custom CSS for mnemonicdictionary.com
#menu li a {
text-transform: lowercase;
font-weight: normal;
font-family: Palatino, "Palatino Linotype", serif;
}
#page_submenu_outer {
display: none;
}