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
// allows you to replace a strings char at a specific index | |
String.prototype.replaceAt=function(index, char) {return this.substr(0, index) + char + this.substr(index+char.length);} |
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/sh | |
# This is the Meteor install script! | |
# | |
# Are you looking at this in your web browser, and would like to install Meteor? | |
# | |
# MAC AND LINUX: | |
# Just open up your terminal and type: | |
# | |
# curl https://install.meteor.com/ | sh |
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
defmodule RethinkDB.Helpers do | |
def run(query) do | |
query | |
|> do_run | |
|> handle_response | |
end | |
def handle_response(%RethinkDB.Exception.ConnectionClosed{}) do | |
raise "Cannot connect to RethinkDB" |
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
defmodule MyApp.RethinkDB.Helpers do | |
def run(query, opts) do | |
query | |
|> MyApp.Database.run(opts) | |
|> handle_response | |
end | |
def run(query) do | |
run(query, []) |
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
module.exports = function(config) { | |
config.set({ | |
basePath: '../../', | |
frameworks: ['jasmine', 'jquery-2.1.0'], | |
plugins: [ | |
'karma-babel-preprocessor', | |
'karma-jquery', | |
'karma-jasmine', | |
'karma-mocha-reporter', | |
], |
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
defmodule App.Helpers do | |
use Timex | |
import App.Rethink, only: [run: 1] | |
alias RethinkDB.Query | |
def get(table, id) when is_bitstring(id) do | |
Query.table(table) | |
|> Query.get(id) |
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
defmodule App.Query do | |
import App.Database, only: [run: 1] | |
alias RethinkDB.Query | |
def get(table, id) when is_bitstring(id) do | |
Query.table(table) | |
|> Query.get(id) | |
|> run | |
|> catch_errors | |
|> handle_get_response |
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
var $ = document.querySelectorAll.bind(document); | |
Element.prototype.on = Element.prototype.addEventListener; | |
$('#somelink')[0].on('touchstart', handleTouch); |
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
IronRouter.prototype.mapResource = function(resource){ | |
var router = this; | |
var _routes = [ | |
{ name: resource, path: '/' + resource, action: 'index' }, | |
{ name: 'show' + resource, path: '/' + resource + '/:id', action: 'show' } | |
]; | |
_.each(_routes, function(route, index){ | |
router.map(function(){ | |
this.route(route.name, { |
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 bash | |
apt-get update | |
apt-get upgrade | |
sudo apt-get install autossh | |
# prevent bruteforce on SSH | |
apt-get install fail2ban | |
# setup firewall |
NewerOlder