<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sandeep C</title><link>https://csandeep.com/</link><description>Recent content on Sandeep C</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 12 Oct 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://csandeep.com/index.xml" rel="self" type="application/rss+xml"/><item><title>On Lisp</title><link>https://csandeep.com/posts/2019-10-12-on-lisp/</link><pubDate>Sat, 12 Oct 2019 00:00:00 +0000</pubDate><guid>https://csandeep.com/posts/2019-10-12-on-lisp/</guid><description>&lt;p>I have a fascination with Lisp / lisp like languages. This started way back when I joined the Emacs religion, part of the initiatiion is to configure your IDE via macros! Much later I tried creating (and failed to maintain) a emacs package that would interact with &lt;a href="https://www.bugzilla.org/">Bugzilla&lt;/a>.&lt;/p>
&lt;p>Another experiment was to use a &lt;a href="http://sawfish.tuxfamily.org/">Sawfish Window Manager&lt;/a> , which is highly configurable via a lisp like programming language &lt;strong>rep&lt;/strong>. This was the early days of Linux desktop, with a plethora of window managers.&lt;/p></description></item><item><title>Beginning Elm</title><link>https://csandeep.com/posts/2018-02-08-beginning_elm/</link><pubDate>Thu, 08 Feb 2018 00:00:00 +0000</pubDate><guid>https://csandeep.com/posts/2018-02-08-beginning_elm/</guid><description>&lt;p>I recently stumbled upon &lt;a href="http://elm-lang.org/">Elm&lt;/a>, a functional reactive programming. I literally spent evenings and nights for
the next 2 weeks pouring over tutorials and videos learning Elm.&lt;/p>
&lt;p>I found these resources really helpful:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://pragmaticstudio.com/elm">Building Web Apps with Elm&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://guide.elm-lang.org/architecture/">The Elm Architecture (aka TEA)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://elmseeds.thaterikperson.com/">Elm Seeds&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>I ported over a search widget to Elm (from KnockoutJS) and that helped cement much of what I learned. The backend is written in &lt;a href="http://mojolicious.org/">Mojolicious&lt;/a>.
I even published my first CPAN module , &lt;a href="http://search.cpan.org/~csandeep/Mojolicious-Plugin-AssetPack-Pipe-ElmLang-0.4/lib/Mojolicious/Plugin/AssetPack/Pipe/ElmLang.pm">Mojolicious::Plugin::AssetPack::Pipe::ElmLang&lt;/a> -
a pipeline to compile Elm source files into Javascript!&lt;/p></description></item><item><title>Key-Value-Coding in PHP</title><link>https://csandeep.com/posts/2018-01-05-kvc_in_php/</link><pubDate>Fri, 05 Jan 2018 00:00:00 +0000</pubDate><guid>https://csandeep.com/posts/2018-01-05-kvc_in_php/</guid><description>&lt;p>Objective-C provides a very concise way of accessing values of any object (&lt;a href="http://nshipster.com/kvc-collection-operators/">that supports NSKeyValueCoding protocol&lt;/a>).&lt;/p>
&lt;p>Here&amp;rsquo;s my attempt at implementing a simple KVC type accessor for PHP arrays.&lt;/p>
&lt;pre tabindex="0">&lt;code>/**
 * value_for_keypath
 *
 * returns value at the given key path in an multi-dimensional array (map)
 *
 * @param $array
 * @param $path string , each path element is separted by a dot (.)
 */
function value_for_keypath($input, $path)
{
	$keys = explode( &amp;#34;.&amp;#34;, $path );
	$tmp_val = $input;

	foreach ($keys as $key) {
		if (isset( $tmp_val[$key] )) {
			$tmp_val = $tmp_val[$key];
		} else {
			return null;
		}
	}

	return $tmp_val;
}
&lt;/code>&lt;/pre>&lt;p>Eg:&lt;/p></description></item><item><title>db migration tool</title><link>https://csandeep.com/posts/2017-10-02-simple-db-migration-tool/</link><pubDate>Mon, 02 Oct 2017 00:00:00 +0000</pubDate><guid>https://csandeep.com/posts/2017-10-02-simple-db-migration-tool/</guid><description>&lt;blockquote>
&lt;p>Simplicity is prerequisite for reliability.&lt;/p>
&lt;p>&amp;ndash; Edsger W. Dijkstra&lt;/p>&lt;/blockquote>
&lt;p>One of the common problem with web-based application is how to handle database migration. Often times the answer to this is to use the migration tool that comes with the &lt;a href="https://martinfowler.com/bliki/OrmHate.html">ORM&lt;/a> the system relies on.&lt;/p>
&lt;p>In the past, as the system grew to use multiple layers each with its own runtime / language / ORM , I was forced to maintain db migration in one of the layer. Thus I came to realize that an ORM agnostic db migration tool would be the ideal approach.&lt;/p></description></item><item><title>Friendly Interactive SHell</title><link>https://csandeep.com/posts/2017-08-15-friendly_interactive_shell/</link><pubDate>Tue, 15 Aug 2017 00:00:00 +0000</pubDate><guid>https://csandeep.com/posts/2017-08-15-friendly_interactive_shell/</guid><description>&lt;p>Continuing my blog theme on repl&amp;rsquo;s whats more appropriate than a blog about shells! Thus far I have been using &lt;a href="https://en.wikipedia.org/wiki/Z_shell">zsh&lt;/a> with &lt;a href="http://ohmyz.sh">oh my zsh&lt;/a>. In itself &lt;code>zsh&lt;/code> is good however it had gotten noticeably slow. I attribute this to the git plugin.&lt;/p>
&lt;p>Enter &lt;a href="http://fishshell.com">Friendly Interactive SHell&lt;/a>! In simple words - &lt;code>fish:zsh::zsh:sh&lt;/code>.&lt;/p>
&lt;p>I no longer need to muck around config files, &lt;code>fish_config&lt;/code> is a shining example of how CLI applications should handle configuration. Here&amp;rsquo;s a screenshot of fish_config&lt;/p></description></item><item><title>A Wordpress shell</title><link>https://csandeep.com/posts/2017-08-10-wordpress-shell/</link><pubDate>Thu, 10 Aug 2017 00:00:00 +0000</pubDate><guid>https://csandeep.com/posts/2017-08-10-wordpress-shell/</guid><description>&lt;p>At &lt;a href="https://themighty.com">The Mighty&lt;/a> my work involves dealing with wordpress extensively. Having a php shell with access to the full wordpress libraries was something I was looking for. I tried couple of php cli hacks before I stumbled on &lt;a href="http://wp-cli.org">WP CLI&lt;/a>. Now getting a php cli with wordpress is as simple as&lt;/p>
&lt;pre tabindex="0">&lt;code>$ wp shell
&lt;/code>&lt;/pre>&lt;p>As a side note &amp;ndash; I created a simple docker container to run &lt;a href="https://hub.docker.com/r/csandeep/centos-php7-apache-wordpress-latest/">wordpress with few extras, here.&lt;/a>&lt;/p></description></item><item><title>A REPL for your Mojolicious app</title><link>https://csandeep.com/posts/2017-06-06-mojo-repl/</link><pubDate>Tue, 06 Jun 2017 00:00:00 +0000</pubDate><guid>https://csandeep.com/posts/2017-06-06-mojo-repl/</guid><description>&lt;p>Read-Eval-Print loop (repl) is a lifesaver, you can quickly hack a script with one. However a repl with full access to your application is vastly more powerful.&lt;/p>
&lt;p>&lt;a href="http://mojolicious.org/">Mojolicious&lt;/a> is a next generation web framework for the perl programming language. There are many things to love about Mojolicious , ease of use is one of them.&lt;/p>
&lt;p>Perl always came with a simple repl but &lt;a href="http://search.cpan.org/~ether/Devel-REPL-1.003028/lib/Devel/REPL.pm">Devel::REPL&lt;/a> took it to the next level. Devel::REPL allows you to tailor the environemt and the following code snippet shows you how to add a interactive shell to your Mojolicious app quickly and simply.&lt;/p></description></item><item><title>Chromebook as a developer machine</title><link>https://csandeep.com/posts/2017-4-01-chromebook-the-future/</link><pubDate>Sat, 01 Apr 2017 00:00:00 +0000</pubDate><guid>https://csandeep.com/posts/2017-4-01-chromebook-the-future/</guid><description>&lt;p>(rebuilding lost blog posts the hard way)&lt;/p>
&lt;p>You can use &lt;a href="https://github.com/dnschneid/crouton">crouton&lt;/a> to install a chroot jail and then you are free to apt-get install any library that&amp;rsquo;s compiles to armv7.&lt;/p>
&lt;p>I have a Samsung Chromebook and I have installed the GAE python sdk , emacs and clozure common lisp for development.&lt;/p>
&lt;p>Its super easy to set this up:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Enter developer mode, for &lt;a href="http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/samsung-arm-chromebook#TOC-Entering-Developer-Mode">Samsung Chromebook follow this procedure.&lt;/a>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Download Crouton&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Ctrl-Alt-T to open terminal , type shell to open a bash shell and run:&lt;/p></description></item><item><title>About</title><link>https://csandeep.com/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://csandeep.com/about/</guid><description>&lt;h2 id="a-brief-list-of-facts-about-me-possibly-outdated">A brief list of facts about me (possibly outdated):&lt;/h2>
&lt;ul>
&lt;li>I favor Go &amp;amp; Javascript&lt;/li>
&lt;li>I love functional programming&lt;/li>
&lt;li>Life long list learner&lt;/li>
&lt;/ul>
&lt;h2 id="me-elsewhere">Me elsewhere&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://github.com/csandeep">https://github.com/csandeep&lt;/a> - All my code&lt;/li>
&lt;li>&lt;a href="https://www.linkedin.com/in/sandeepchayapathi">https://www.linkedin.com/in/sandeepchayapathi&lt;/a> - My LinkedIn Profile&lt;/li>
&lt;li>&lt;a href="https://www.flickr.com/photos/csandeep">https://www.flickr.com/photos/csandeep&lt;/a> - My Photos&lt;/li>
&lt;/ul></description></item></channel></rss>