Skip to content

Instantly share code, notes, and snippets.

View ejamesc's full-sized avatar

Cedric Chin ejamesc

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def url_all_categories(categories, sumlist)
if len(categories) == 0: # end condition
return []
else:
for cat in categories:
sub_categories = url_sub_categories(cat)
sumlist.extend(sub_categories)
url_all_categories(sub_categories, sumlist)
return sumlist
\set QUIET 1
\pset null '¤'
\set PROMPT1 '%[%033[1m%][%/] # '
-- SELECT * FROM<enter>. %R shows what type of input it expects.
\set PROMPT2 '... > '
\timing
\x auto
gulp.task('redirects', function () {
return gulp.src('src/_redirects')
.pipe(gulp.dest('dist'));
});

I think it’s always a good idea to start with the primary sources. LKY has written a number of books in his lifetime; I’ve listed the set of books that would probably be more relevant to a non-resident of Singapore:

I will say, though, that the best LKY biography has not yet been written — and may never be written, though one remains hopeful.

Sorry, let me back up a bit. If you go to Amazon right now and purchase all the LKY-related books and biographies, you'll be getting things written before his death, which means that th

@ejamesc
ejamesc / delete_git_submodule.md
Created February 9, 2019 11:58 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@ejamesc
ejamesc / en.json
Created September 11, 2018 15:58
en.json modified 'Book Summaries'
{
"Book Summaries": "Gear Reviews",
"By": "By",
"More in": "More in",
"Previous post": "Previous post",
"Next post": "Next post",
"Subscribe": "Subscribe",
"Categories": "Categories",
"Latest": "Latest",
"Colophon": "Colophon",
@ejamesc
ejamesc / en.json
Created September 11, 2018 15:54
Example modified locale/en.json for the Commonplace theme
{
"Book Summaries": "Book Summaries",
"By": "By",
"More in": "More in",
"Previous post": "Previous post",
"Next post": "Next post",
"Subscribe": "Subscribe",
"Categories": "Categories",
"Latest": "Latest",
"Colophon": "Colophon",
@ejamesc
ejamesc / home2.hbs
Last active September 11, 2018 15:56
Modified home.hbs
{{!-- CHANGE this filter to filter for the category you'd like --}}
{{#get "posts" filter="tag:[gear]" limit="4" as |books|}}
{{#if books}}
<div class='row'>
<div class='small-12 columns'>
{{!-- CHANGE this url to "/tag/<tagname>" to link to the tag addres --}}
<h2 class='home__books-section-heading'><a class="home__books-section-heading__a" href="{{@blog.url}}/tag/gear">{{t "Book Summaries"}}</a></h2>
</div>
</div>
<div class='row home__books'>
{{!-- CHANGE this filter to filter for the category you'd like --}}
{{#get "posts" filter="tag:[books]" limit="4" as |books|}}
{{#if books}}
<div class='row'>
<div class='small-12 columns'>
{{!-- CHANGE this url to "/tag/<tagname>" to link to the tag addres --}}
<h2 class='home__books-section-heading'><a class="home__books-section-heading__a" href="{{@blog.url}}/tag/books">{{t "Book Summaries"}}</a></h2>
</div>
</div>
<div class='row home__books'>