Skip to content

Instantly share code, notes, and snippets.

View alexdiliberto's full-sized avatar

Alex DiLiberto alexdiliberto

View GitHub Profile
@jamesarosen
jamesarosen / ember-xss.md
Created October 28, 2015 16:50
Ember and XSS Safety

TL;DR

In Ember, always use {{...}}, not {{{...}}}. Use Ember.String.htmlSafe as necessary in JavaScript (usually in a component) to mark markup as HTML-safe. Never pass user-entered content directly to Ember.String.htmlSafe.

Details

Ember has great XSS protection built in. The HTMLBars templating library will automatically run any interpolations through htmlEscape for you. So

@amk221
amk221 / escape.js
Last active February 9, 2016 17:45
Ember escape helper
import Ember from 'ember';
import { helper } from 'ember-helper';
import { htmlSafe } from 'ember-string';
const { escapeExpression } = Ember.Handlebars.Utils;
/**
* This helper escapes a value, useful for building styles
*
* @example
* <div style={{escape (concat 'color:' ugcColour)}}></div>
@runspired
runspired / .bash_profile
Last active February 6, 2023 14:56
Make Alfred / Spotlight ignore node_modules and bower_components
alias nom='npm cache clean && rm -rf node_modules && mkdir node_modules && touch node_modules/.metadata_never_index && npm install'
alias bom='bower cache clean && rm -rf bower_components && mkdir bower_components && touch bower_components/.metadata_never_index && bower install'
@lowleveldesign
lowleveldesign / UpdateChocolatey.bat
Last active March 11, 2025 17:21
Scripts to automatically update all Chocolatey packages installed on your system
@echo off
powershell -NoProfile -ExecutionPolicy ByPass -File "%~d0%~p0%~n0.ps1"
@bmhatfield
bmhatfield / .profile
Last active January 29, 2025 11:11
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@cvan
cvan / HOWTO.md
Last active February 27, 2025 14:41
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@ivanvanderbyl
ivanvanderbyl / Instructions.md
Last active March 10, 2017 14:54
Fix <base> tag in Ember so that SVG patterns and defs work correctly
  1. Add this to your devDependencies in package.json.
"ember-cli-replace": "^0.3.0",
  1. Add the replace config of ember-cli-build to yours.
  2. Replace baseURL with rootURL in /config/environment.js.
  3. Configure router to use rootURL, as seen in router.js
  4. Update your app/index.html as per app-index.html below, such that you just append @@ in place of assets. This will be used as the replace instruction when compiling. For some reason regex doesn't work as expected.
@BrianSipple
BrianSipple / ember-addon-essentials.md
Last active April 17, 2017 18:27
Ember Addon Essentials -- A checklist of some of the finer details to keep in mind when developing Ember addons

Ember Addon Essentials

This document is meant to be a brief "checklist" of things to setup for your Ember addon when beginning development in order to have the best possible architecture and workflow out of the gate. For more comprehensive material, the following are bookshelf-caliber:

Filling out package.json

@kidGodzilla
kidGodzilla / invert-binary-tree.js
Created May 28, 2016 19:42
Invert a Binary Tree in Javascript
// This problem was inspired by this original tweet by Max Howell:
// Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.
// So, let's invert a binary tree in Javascript
// Original Tree
// 4
// / \
// 2 7
// / \ / \
@tim-evans
tim-evans / helpers.is-active.js
Last active June 10, 2016 20:53
Router Service RFC polyfill
import Ember from 'ember';
const { get, observer } = Ember;
/**
Returns whether a route is currently active
Example:
```handlebars