Skip to content

Instantly share code, notes, and snippets.

import DS from 'ember-data';
import Ember from 'ember';
export function initialize(/* container, application */) {
DS.Model.reopen({
saveOriginalRelations: function() {
this.originalRelations = {};
@masciugo
masciugo / fennel_accounts_test.js
Created May 18, 2017 13:12
fennel-dev test file
import { assert } from 'chai';
import co from 'co';
import * as dav from '../../lib';
suite('accounts', function() {
suite('#create', function() {
let xhr;
setup(function() {
@masciugo
masciugo / node_env.py
Created August 10, 2017 14:44 — forked from joesepi/node_env.py
Updated python script to manage nvm and ST3 pathing for OSX
# Sublime package NVM node path configuration
# Save this file in:
# ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/node_env.py
import os
os.environ["PATH"] = "/Users/YOUR_USERNAME/.nvm/v0.10.26/bin:/Users/cranemes/.nvm/v0.10.26/lib:/Users/YOUR_USERNAME/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
print("PATH=" + os.environ["PATH"])
require 'openssl'
require "base64"
KEY = '1'*32
IV = '1'*16
ALG = 'aes-256-cbc'
def encrypt(plaintext)
cipher = OpenSSL::Cipher.new(ALG)
cipher.encrypt
require 'openssl'
KEY = '1'*32
IV = '1'*12
ALG = 'aes-256-gcm'
def bin2hex(s)
s.unpack('H*').first
end
$(() => {
if (location.hash) {
$("a[href='" + location.hash + "']").tab("show"); // go to tab when hash is present in the url
}
$(document.body).on("click", "a[data-toggle]", function(event) {
location.hash = this.getAttribute("href"); // add hash to url when change tab
});
});
$(window).on("popstate", function() { // make history navigation aware of anchor
var anchor = location.hash || $("a[data-toggle='tab']").first().attr("href");