Skip to content

Instantly share code, notes, and snippets.

@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

@ybogdanov
ybogdanov / platform.yml
Last active November 28, 2016 00:26
A manifest that describes "platform" agents that we run on every instance. See http://tech.grammarly.com/blog/posts/How-We-Deploy-Containers-at-Grammarly.html
# This is a manifest that describes "platform" agents that we run on every instance.
# It includes auxilary services that work alongside with the application containers
# to provide logging and monitoring.
#
# This file looks a bit tough, but that's what happens when you meet the reality.
# We have also pruned it a bit to remove our company specifics.
#
# You may notice "env", "role" and "track" variables. We specify them as EC2 instance
# tags and pass them to rocker-compose on every run. This allows us to distinguish
# instances and do basic service discovery and A/B testing.

Generated within the iPhone Simulator (iOS Version 8.4 (12H141))

XS S M L XL XXL XXXL Accessibility M AccessibilityL AccessibilityXL AccessibilityXXL AccessibilityXXXL
UIFontTextStyleHeadline 14.0 15.0 16.0 17.0 19.0 21.0 23.0 23.0 23.0 23.0 23.0 23.0
UIFontTextStyleSubheadline 12.0 13.0 14.0 15.0 17.0 19.0 21.0 21.0 21.0 21.0 21.0 21.0
UIFontTextStyleBody 14.0 15.0 16.0 17.0 19.0 21.0 23.0 28.0 33.0 40.0 47.0 53.0
UIFontTextStyleFootnote 12.0 12.0 12.0 13.0 15.0 17.0 19.0 19.0 19.0 19.0 19.0 19.0
UIFontTextStyleCaption1 11.0 11.0 11.0 12.0 14.0 16.0 18.0 18.0 18.0 18.0 18.0 18.0
UIFontTextStyleCaption2 11.0 11.0 11.0 11.0 13.0 15.0 17.0 17.0 17.0 17.0 17.0 17.0
@AliSoftware
AliSoftware / struct_vs_inheritance.swift
Last active March 27, 2024 11:57
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
@Baza207
Baza207 / UICollectionViewControllerExtensions
Last active September 14, 2016 15:10
A Swift extension for UICollectionViewController to allow setting and getting a UIRefresh control in the same manor as UITableViewController.
///
/// Extention functions for UICollectionViewController
///
extension UICollectionViewController {
/// Allows easy access to a collection view controller's refrsh control the same way as in a table view controller.
var refreshControl: UIRefreshControl? {
get {
return collectionView?.viewWithTag(140412014669856) as? UIRefreshControl
}
set {
@marshall007
marshall007 / retry-promise.coffee
Created July 28, 2014 20:15
Retries with exponential backoff using Bluebird
_ = require 'lodash'
Promise = require 'bluebird'
Promise.retry = (action, options = {}) ->
_.merge
max: 5
backoff: 500
, options
d = Promise.defer()
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
If (Test-Path "cloud_package.cspkg") {
Remove-Item "cloud_package.cspkg" -Force
}
cd "WebRole"
iex "git reset --hard origin/master"
iex "git pull"
cmd /C "rmdir /S /Q node_modules"
exports.xForwardedFor = function(req, res, next) {
if (!req.headers['x-forwarded-for']) {
if (req.headers['x-iis-node-remote_addr']) {
req.headers['x-forwarded-for'] = req.headers['x-iis-node-remote_addr'];
}
}
next();
};
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 19, 2024 17:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@guillaumevincent
guillaumevincent / installation.md
Last active October 28, 2023 12:05
A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.

Guide to install PyQt5 on Mac OS X with python 3.4 virtualenv

Description

A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.

Requirements

  • xcode 5.1.1
  • python 3.4.0
  • Qt libraries 5.2.1