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
define(['angular'], function(angular){ | |
/** | |
* Converts any links inside the passed in text parameter into HTML links. | |
*/ | |
angular.module('Filters') | |
.filter('Autolink', function(){ | |
var urlPattern = /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/gi; |
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
package com.onsails.pixel.spark | |
import java.text.SimpleDateFormat | |
import java.util.Date | |
import org.apache.hadoop.conf.Configuration | |
import org.apache.hadoop.io.Writable | |
import org.apache.hadoop.mapreduce._ | |
import org.kiji.mapreduce.framework.KijiTableInputFormat | |
import spark.{Dependency, RDD, SerializableWritable, SparkContext, Split, TaskContext} | |
import org.kiji.schema.{KijiRowData, EntityId} |
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 | |
set -e | |
set -u | |
EXPECTED_ARGS=2 | |
E_BADARGS=65 | |
if [ $# -ne $EXPECTED_ARGS ] | |
then | |
echo "Usage: $0 master_hostname node_hostname" |
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
def IsAuthenticated( | |
f: => AuthenticatedRequest => Result, | |
x: => RequestHeader => Result = onUnauthorized) = { | |
Security.Authenticated(sessionUserId, x) { id => | |
User.findById(id.toLong).map { user => | |
Action(request => f(AuthenticatedRequest(user, request))) | |
}.getOrElse( | |
Action(request => onUnauthorized(request).withSession(Session()))) | |
} | |
} |
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
# GNU Screen configuration file | |
# | |
# Balaji S. Srinivasan <balajis_at_stanford_dot_edu> | |
# This file can be found at http://jinome.stanford.edu/stat366/unix/.screenrc | |
# Modified to play well with emacs, by moving Ctrl-A to Ctrl-T | |
# Modification of original files by Sven Guckes, Sarunas Vancevicius, and Mike Perry | |
# Sarunas Vancevicius original: http://www.redbrick.dcu.ie/~svan/configs/screenrc | |
# Mike Perry original: http://fscked.org/writings/225notes/unix/.screenrc |
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 php | |
<?php | |
class ActiveResource { | |
/** | |
* The REST site address, e.g., http://user:pass@domain:port/ | |
*/ | |
var $site = 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
require 'couchrest_extended_document' | |
require 'couchsphinx' | |
require 'lib/sdb' | |
class Content < CouchRest::ExtendedDocument | |
use_database SERVER.default_database | |
property :content | |
property :title | |
property :url |
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
# :%s/%appname%/_appname_/g | |
# :%s/%appname%/_username_/g | |
# :%s/%domain%/_domain_/g | |
set :application, "%appname%" | |
set :repository, "git@github.com:smix/%appname%.git" | |
set :deploy_to, "/var/rails/%appname%" | |
set :deploy_via, :remote_cache | |
set :branch, 'master' | |
set :scm, :git |
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
<?php | |
echo <<<EOS | |
<?xml version="1.0" encoding="UTF-8" ?> | |
<Module> | |
<ModulePrefs title="My sponsors" /> | |
<Content type="html"> | |
<![CDATA[ | |
<div style="background-color: #710;"> | |
EOS; | |
if (!defined('_SAPE_USER')){ |
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
File.open("/etc/passwd").each_line do |line| | |
arr = line.split(":") | |
puts "#{arr.first} - #{arr.last}" | |
end | |
File.open("/etc/passwd") do |io| | |
io.each_line do |line| | |
arr = line.split(":") | |
puts "#{arr.first} - #{arr.last}" | |
end |