Skip to content

Instantly share code, notes, and snippets.

/* Base styles */
body {}
p {}
/* .layout-{name} */
.layout-sidebar {}
@hadynz
hadynz / Box-Shadow (top and bottom only)
Last active August 29, 2015 14:02
Inset box-shadow on top and bottom only
-moz-box-shadow: inset 0 8px 8px -8px #696868,
inset 0 -8px 8px -8px #696868;
-webkit-box-shadow: inset 0 8px 8px -8px #696868,
inset 0 -8px 8px -8px #696868;
box-shadow: inset 0 8px 8px -8px #696868,
inset 0 -8px 8px -8px #696868;
public static class EvalExtension
{
public static TResult Eval<T, TResult>(this T obj, Func<T, TResult> func) where T : class
{
return obj.Eval(func, default(TResult));
}
public static TResult Eval<T, TResult>(this T obj, Func<T, TResult> func, TResult defaultValue) where T : class
{
return obj == null ? defaultValue : func(obj);

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@hadynz
hadynz / checkout-latest-tag.sh
Last active February 15, 2017 14:27
Checkout the latest tag of a Git repository
# Get new tags from the remote
git fetch --tags
# Get the latest tag name
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
# Checkout the latest tag
git checkout $latestTag
@hadynz
hadynz / gist:5ea16d3f87f776473590
Last active August 29, 2015 14:05
Arabic Kodi Roadmap

Arabic Kodi Roadmap

Issues with current state

  • The Arabic XBMC repository has grown in popularity and has had a lot of interest and contribution from the community. Moving the repository from my personal namespace hadynz to ArabicKodi will reflect this growing maturity.
  • Many new developers want to showcase their work in the Arabic Repository. The following are challenges to open up contributions:
  • Lack of contribution guidelines
  • The repository XML config file is often not updated - meaning that new plugins do not show via the XBMC addon interface.
  • Without the requirement for unit tests, the quality of the Arabic repository cannot be guaranteed and its 'working' state not easily audited
  • Lack of a "source of truth" to the latest updates and state of the Arabic repository. Users need to farm through many forum posts to get updates on how things are progressing
  • Because the repository now features many plugins, the GitHub issues has become an entangled heap making it slow to respond to

##Jama and Ractive.js

Jama has been originally focused on hiring full stack/Java developers. As of May 2012 the first full time front end developer was hired, and I was hired shortly after in July. Jama is mostly a monolithic ExtJS application which is great if you know nothing about front end development and want something up relatively quickly and easily and do not understand how to build structure your own HTML/CSS well.

Our goal was to replace ExtJS but rebuilding the application from the ground up was not an option. So we devised a plan to utilize Ext Containers that would simply render on the page and allow us to use whatever we wanted in them. This allows us to start granular and slowly start replacing larger and larger Ext components.

Another part of the application was already built with AMD modules so in order to encourage module reuse we extend Ext container, and implement a few methods to pull in an AMD module, pass in configuration data that may be still coming from the Ext world, bind to nec

@hadynz
hadynz / names.css
Last active August 29, 2015 14:17 — forked from wrumsby/names.css
/* Base styles */
body {}
p {}
/* .layout-{name} */
.layout-sidebar {}
@hadynz
hadynz / flex-grid.css
Created May 15, 2015 02:29
Flexbox grid component - inspired by Shopify
.flex-grid {
display: flex;
box-sizing: border-box;
padding-top: 10px;
width: calc(100% - 20px);
margin: 0 auto;
}
.flex-grid:last-of-type {
padding-bottom: 10px;
@hadynz
hadynz / WindowsOnMac.ahk
Created October 18, 2015 07:51
AutoHotkey script for remapping Mac keys for better programming on Windows
; Remap Right Windows Key to Alt
RWin::RAlt
; Remap Right Alt to Ctrl
RAlt::RCtrl
; Remap Right Alt + Space to Ctrl + Space
RAlt & Space::Send ^{Space}