Skip to content

Instantly share code, notes, and snippets.

View clauswitt's full-sized avatar

Claus Witt clauswitt

View GitHub Profile
var sys = require('sys');
var Euler1 = function() {
var useNumber = function(num) {
if((num % 3)==0) return true;
if((num % 5)==0) return true;
return false;
}
var getResult = function() {
var sys = require('sys');
var Euler2 = function() {
var isEven = function(num) {
if((num % 2)==0) return true;
return false;
}
var calcEvenFibonacci = function(max) {
var sys = require('sys');
var Euler3 = function() {
var isPrimeNumber = function(num) {
//1 is NOT a prime number
if(num == 1) return false;
//2 is a prime number.
if(num == 2) return true;
//Exit early for even numbers (except 2 which is the only equal prime number).
var sys = require('sys');
var Euler4 = function() {
var isPalindromicNumber = function(num) {
var digitString = num.toString();
var reverseString = digitString.split('').reverse().join('');
return (digitString==reverseString);
}
cd /the/git/repo/directory
svn export svn+ssh://[email protected]/repo/dir . --force
git add *
git commit -m "Initial import from subversion"
git push
var sys = require('sys');
var Euler5 = function() {
var factorial = function(num) {
var res = 1;
for(var i=num;i>1;i--) {
res = i*res;
}
return res;
}
Search
(.)*(".*")(,)(".*")((ht|f)tp:\/\/w{0,3}[a-zA-Z0-9_\-.:#/~}]+)(",")((ht|f)tp:\/\/w{0,3}[a-zA-Z0-9_\-.:#/~}]+)(.)*([0-9]{8})
Replace
mkdir $11\ncd $11\nwget $5\nwget $8\ncd ..
public function testGetRomanNumeral()
{
$this->assertEquals('M', $this->object->getRomanNumeral(1000));
$this->assertEquals('C', $this->object->getRomanNumeral(100));
$this->assertEquals('X', $this->object->getRomanNumeral(10));
$this->assertEquals('I', $this->object->getRomanNumeral(1));
$this->assertEquals('D', $this->object->getRomanNumeral(500));
$this->assertEquals('L', $this->object->getRomanNumeral(50));
$this->assertEquals('V', $this->object->getRomanNumeral(5));
public function testGetNumber()
{
$this->assertEquals(1000, $this->object->getNumber('M'));
$this->assertEquals(100, $this->object->getNumber('C'));
$this->assertEquals(10, $this->object->getNumber('X'));
$this->assertEquals(1, $this->object->getNumber('I'));
$this->assertEquals(500, $this->object->getNumber('D'));
$this->assertEquals(50, $this->object->getNumber('L'));
$this->assertEquals(5, $this->object->getNumber('V'));
using terms from application "Quicksilver"
on open thefiles
repeat with afile in thefiles
set afile to afile as text
tell application "VLC"
activate
OpenURL afile
play
fullscreen
end tell