Skip to content

Instantly share code, notes, and snippets.

NSImage* image = [NSImage imageNamed:NSImageNameAdvanced];
NSData* data = [image TIFFRepresentation];
[data writeToFile:@"/Users/haseebq/adv.tiff" atomically:YES];
{% if article.featuredimages %}
{% for pair in article.featuredimages.split(', ') %}
{% set pairList = loop.cycle(pair.split(':')) %}<br/>
{% for item in pairList %}
{{ item }}<br/>
{% endfor %}
{% for pair in article.featuredimage.split(',') %}
{% set parilist = loop.cycle(pair.split(':')) %}
<li>
<img src="{{ASSETSURL}}/media/photos/{{pairlist[0]}}" alt="{{article.title}}">
<p class="caption">{{pairlist[1]}}</p>
</li>
{% endfor %}
{% if article.productvariations %}
{% for category_groups in article.productvariations.split('|') %}
{% for category in category_groups.split('=') %}
{% if loop.first %}
<h1>{{ category }}</h1>
{% else %}
<ul>
{% for list in category.split(',') %}
<li>{{ list }}
{% endfor %}
{% if article.productvariations %}
{% for category_groups in article.productvariations.split('|') %}
{% for category in category_groups.split('=') %}
{% if loop.first %}
<h1>{{ category }}</h1>
{% else %}
<ul>
{% for list in category.split(',') %}
{% set splitted = list.split(':') %}
<li>{{ splitted[0] }} {{ splitted[1] }}
@talha131
talha131 / _defaults.html
Last active December 30, 2015 16:57
How to translate Pelican-Elegant theme to other languages
Edit file at path `pelican-elegant/templates/_includes/_defaults.html`
https://github.com/talha131/pelican-elegant/blob/master/templates/_includes/_defaults.html
Replace strings with translated strings.
For example,
{# Placeholder text for Email field #}
{% if not EMAIL_FIELD_PLACEHOLDER %}

Keybase proof

I hereby claim:

  • I am talha131 on github.
  • I am talha131 (https://keybase.io/talha131) on keybase.
  • I have a public key ASDOCGitJH5AgkCZunB_jILKO8WDifZ_kiVsNTcZC86xqwo

To claim this, I am signing this object: