Skip to content

Instantly share code, notes, and snippets.

View algorithmcardboard's full-sized avatar

Anirudhan J Rajagopalan algorithmcardboard

View GitHub Profile

Keybase proof

I hereby claim:

  • I am algorithmcardboard on github.
  • I am anirudhan (https://keybase.io/anirudhan) on keybase.
  • I have a public key ASAidpQJgiu9yWqhl3pYTCHeq2VNHs7ZRl7VqNq823PiYgo

To claim this, I am signing this object:

@algorithmcardboard
algorithmcardboard / test.html
Created June 25, 2019 21:11
Hello World Html
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
@algorithmcardboard
algorithmcardboard / test.md
Last active June 25, 2019 21:12
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@algorithmcardboard
algorithmcardboard / service-workers.md
Created August 29, 2018 21:52 — forked from Rich-Harris/service-workers.md
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@algorithmcardboard
algorithmcardboard / racist-ai.ipynb
Last active December 7, 2017 07:08
Racist AI without trying
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@algorithmcardboard
algorithmcardboard / EagerSingleton.java
Created December 20, 2013 17:49
Eager loading singleton
package in.rajegannathan.singletons;
/**
* Example class for a eager loading singleton.
* The declaration of instance - instance variable should have both static and final.
* Without final we might lose the initialization safety that final provides
*/
public class EagerSingleton {
private static final EagerSingleton instance = new EagerSingleton();
@algorithmcardboard
algorithmcardboard / placeholder.js
Last active September 14, 2018 18:12
Angularjs Placeholder directive. Placeholder text is removed on first input rather than focus
(function(angular, app) {
"use strict";
app.directive('placeholder',["$document", "$timeout", function($document, $timeout){
var link = function(scope,element,attrs,ctrl){
// if you dont use modernizr library use the solution given at
// http://stackoverflow.com/questions/5536236/javascript-check-for-native-placeholder-support-in-ie8
// to check if placeholder is supported natively
if(Modernizr.input.placeholder){
return;