This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(() => { | |
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
KEY = '1'*32 | |
IV = '1'*12 | |
ALG = 'aes-256-gcm' | |
def bin2hex(s) | |
s.unpack('H*').first | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
require "base64" | |
KEY = '1'*32 | |
IV = '1'*16 | |
ALG = 'aes-256-cbc' | |
def encrypt(plaintext) | |
cipher = OpenSSL::Cipher.new(ALG) | |
cipher.encrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { assert } from 'chai'; | |
import co from 'co'; | |
import * as dav from '../../lib'; | |
suite('accounts', function() { | |
suite('#create', function() { | |
let xhr; | |
setup(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
import Ember from 'ember'; | |
export function initialize(/* container, application */) { | |
DS.Model.reopen({ | |
saveOriginalRelations: function() { | |
this.originalRelations = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'mechanize' | |
require 'open-uri' | |
require 'byebug' | |
class Zeitung | |
attr_accessor :uri | |
attr_reader :final_name, :regexp, :move | |
def initialize(final_name, regexp, move=false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.switch { | |
position: relative; | |
} | |
.switch:hover .replace { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'fastercsv' | |
require 'ruby-debug' | |
require 'logger' | |
log = Logger.new(STDOUT, File::WRONLY | File::APPEND | File::CREAT) | |
log.level = Logger::DEBUG | |
log.datetime_format = "%Y-%m-%d %H:%M:%S" |
NewerOlder