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 'rubygems' | |
require 'bundler/setup' | |
require 'sinatra' | |
require 'securerandom' | |
NOTES = {} | |
get '/' do | |
response = '<html><body>' | |
response << %Q{<h1>Create secret note</h1>} |
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
/** | |
* Authentication session handling token and user id | |
*/ | |
angular.module('fn.services.authentication', []) | |
.service('srvAuthenticationSession', ['$window', function ($window) { | |
this.save = function() { | |
var data = {'userId':this.userId, 'token':this.token}; | |
$window.localStorage['com.fansnation.authorisationSession'] = JSON.stringify(data); | |
} |
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
angular | |
.module("core.analytics", []) | |
.service("Analytics", function($rootScope, $state){ | |
this.handle = null; | |
this.setup = function(handle, trackerID){ | |
if (!handle) { | |
console.log("Analytics: Unable to initialize plugin!"); | |
return 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 lang="en_GB"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Content</title> | |
<script type="text/javascript" src="./print.js"></script> | |
<style> | |
/* Page layout, header, footer */ | |
body { |
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
" We're running Vim, not Vi! | |
set nocompatible | |
" Enable syntax highlighting | |
syntax on | |
" Faster response | |
set ttyfast | |
" No bell sound | |
set visualbell | |
" Line numbering | |
set number |
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 -w | |
owner = 'pavel.kunc@gmail.com' | |
gems = %w{ | |
merb | |
merb-action-args | |
merb-assets | |
merb-auth-core | |
merb-auth-more | |
merb-auth-slice-password |
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 ::File.expand_path('.bundle/environment', __FILE__) | |
rescue LoadError | |
require 'rubygems' | |
require 'bundler' | |
Bundler.setup | |
end | |
require 'merb-core' | |
Merb::Config.setup(:merb_root => ::File.expand_path(::File.dirname(__FILE__)), |
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
#!/bin/bash | |
FROM=$1 | |
TO=$2 | |
echo "Spliting '$TO' from '$FROM'" | |
git clone --no-hardlinks $FROM $TO | |
cd $TO | |
git filter-branch --subdirectory-filter $TO HEAD -- --all | |
git reset --hard | |
git gc --aggressive | |
git prune |
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
# vim:set filetype=ruby: | |
begin | |
require ::File.expand_path('.bundle/environment', __FILE__) | |
rescue LoadError | |
require 'rubygems' | |
require 'bundler' | |
Bundler.setup | |
end | |
require 'merb-core' |
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
#!/bin/bash | |
CURRENT_DIR=`pwd` | |
for dir in $(find $1 -type d -depth 1 -not -name "\.*"); | |
do | |
cd $dir | |
if [ -f *.gem ]; then | |
rm -rv *.gem | |
fi |
OlderNewer