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
ruleset examine_location { | |
meta { | |
name "Examine Location Data" | |
description << | |
Examine Location Data | |
>> | |
author "" | |
logging off | |
use module b505206x2 alias LocationData | |
} |
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
ruleset a2294x3 { | |
meta { | |
name "Hello World" | |
description << | |
Hello World | |
>> | |
author "" | |
logging off | |
use module a169x701 alias CloudRain | |
use module a41x186 alias SquareTag |
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
ruleset a2294x2 { | |
rule first_rule is active { | |
select when pageview ".*" setting () | |
pre { | |
results = << | |
<dl id="results" style="display:none"> | |
<dt></dt> | |
<dd><img id="thumbnail" src=""></dd> | |
<dt>Title</dt> |
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
ruleset a2294x1 { | |
rule show_form is active { | |
select when pageview "ktest\.heroku\.com" | |
pre { | |
firstName = ent:firstName; | |
lastName = ent:lastName; | |
form = << | |
<form id="simple_form"> | |
<input placeholder="First Name" name="first_name"><br> |
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
'use strict'; | |
var angular = require('angular'); | |
module.exports = function LoginFormDirective ($compile) { | |
return { | |
restrict: 'E', | |
template: require('./loginFormTemplate.html'), | |
link: function (scope, element) { | |
// Already compiled! |
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
ruleset HelloWorldApp { | |
rule Excercise1 is active { | |
select when pageview ".*" | |
{ | |
notify("Hello World", "This is a sample rule.") with sticky = true; | |
notify("Another One", "Notification 2.") with sticky = true; | |
} | |
} | |
rule Exercise4 is active { |
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 | |
wget "https://gist.github.com/trevordixon/8413132/raw/index.html" -O /var/www/index.html |
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
// MIT License: | |
// | |
// Copyright (c) 2010-2012, Joe Walnes | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
extendedEu :: Integer -> Integer -> (Integer, Integer) | |
extendedEu a 0 = (1, 0) | |
extendedEu a b = (t, s - q * t) | |
where (q, r) = quotRem a b | |
(s, t) = extendedEu b r |
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 System.Random | |
import Math.NumberTheory.Primes.Testing | |
rndPrime :: Int -> IO Integer | |
rndPrime bits = do | |
x <- fmap (.|. 1) $ randomRIO (2^(bits - 1), 2^bits - 1) | |
if isPrime x then return x else rndPrime bits |