Skip to content

Instantly share code, notes, and snippets.

@jaysonrowe
jaysonrowe / FizzBuzz.js
Created January 11, 2012 01:39
FizzBuzz JavaScript solution
for (var i=1; i <= 20; i++)
{
if (i % 15 == 0)
console.log("FizzBuzz");
else if (i % 3 == 0)
console.log("Fizz");
else if (i % 5 == 0)
console.log("Buzz");
else
console.log(i);
@jaysonrowe
jaysonrowe / test_gmail.cs
Created November 12, 2012 03:19
Checking Gmail with Selenium Webdriver in C#
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
namespace TestingSeleniumGmail
{
[TestClass]
public class FillFormIntegrationTest
{
@jaysonrowe
jaysonrowe / FizzBuzz.py
Created January 11, 2012 03:05
FizzBuzz Python Solution
def fizzbuzz(n):
if n % 3 == 0 and n % 5 == 0:
return 'FizzBuzz'
elif n % 3 == 0:
return 'Fizz'
elif n % 5 == 0:
return 'Buzz'
else:
return str(n)
@jaysonrowe
jaysonrowe / .muttrc
Created May 6, 2012 23:10
Mutt Configuration
# basic .muttrc for use with Gmail
# Change the following six lines to match your Gmail account details
set imap_user = "username@gmail.com"
set imap_pass = ""
set smtp_url = "smtp://username@smtp.gmail.com:587/"
set smtp_pass = ""
set from = "username@gmail.com"
set realname = "Firstname Lastname"
#
@jaysonrowe
jaysonrowe / postfix.php
Created March 22, 2012 18:50
Parse e-mail with PHP
#!/usr/bin/php -q
<?php
// get mail via stdin
$email = file_get_contents("php://stdin");
// handle email
$lines = explode("\n", $email);
// set empty vars and explode message to variables
@jaysonrowe
jaysonrowe / gmail_test.py
Created November 12, 2012 03:15
Checking Gmail with Selenium Webdriver in Python
#! /usr/bin/env python
import unittest
from selenium import webdriver
class TestGmail(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
@jaysonrowe
jaysonrowe / output.txt
Created November 15, 2012 03:31
ruby output
Loaded suite gmail_test
Started
..
Finished in 10.522909003 seconds.
2 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
@jaysonrowe
jaysonrowe / backup
Created September 6, 2013 01:47
backup script
#!/bin/sh
LOG=/var/log/backup.log
echo "*** $(date -R) ***" >> $LOG
rsync -av --delete /home/jayson /storage/backup
rsync -av --delete /home/jayson /data/backup
@jaysonrowe
jaysonrowe / fonts.conf
Last active December 22, 2015 06:39
fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
<edit mode="assign" name="hinting">
@jaysonrowe
jaysonrowe / trim
Created September 4, 2013 03:38
trim script
#!/bin/sh
LOG=/var/log/trim.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v /boot >> $LOG
fstrim -v / >> $LOG
fstrim -v /home >> $LOG