Skip to content

Instantly share code, notes, and snippets.

View cerkit's full-sized avatar

cerkit cerkit

View GitHub Profile
@cerkit
cerkit / bootstrap_merged_menu_example.php
Last active January 2, 2016 00:44
Bootstrap Navbar on WordPress with merged menus
<nav id="top-navbar" class="navbar navbar-default navbar-fixed-top" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" rel="home">
@cerkit
cerkit / link-to-icon-mapper.js
Last active February 16, 2016 16:45
This code is used to add Font Awesome fonts to dynamically generated navigation links based on a link-to-icon map. To use this code, make sure you have a reference to Font Awesome (http://fontawesome.io) and jQuery.
@cerkit
cerkit / SampleMarkdownWithCodeProblem.cs
Created March 24, 2016 16:41
Markdown with code embedded in a <pre /> tag.
<pre class="line-numbers"><code class="language-csharp">static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
// toggle between words and paragraphs
bool isEven = (i % 2) == 0;
bool isThird = (i % 3) == 0;
LipsumType lipsumType = isEven ? LipsumType.Paragraphs : LipsumType.Words;
// only start with Lorem Ipsum every third call
@cerkit
cerkit / UseAsOrCast.cs
Last active March 28, 2016 22:17
I have a dilemma. Should I use line 4, 8, 12, or 16?
// Dilemma, should I use this code:
// NOTE: existingJobDetail.Id is defined as a regular (non-nullable) int.
int? parentJobDetailId = existingJobDetail != null ? existingJobDetail.Id as int? : null;
// Or this code:
int? parentJobDetailId = existingJobDetail != null ? (int?)existingJobDetail.Id : null;
// Or (less likely):
@cerkit
cerkit / modifyVectorMapBorder.html
Last active June 1, 2016 13:24
Modify the border on a DevExtreme dxVectorMap widget using jQuery
<div id="mapContainer"></div>
<script type="text/javascript">
// attach map to mapContainer
var map = $("#mapContainer").dxVectorMap({
// config goes here...
}).dxVectorMap('instance');
// remove the border around the map
$("#mapContainer").children("svg:first").children("rect:first").attr("stroke-width", "0");