This file contains hidden or 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
| huntMen = (buffy) -> | |
| soulmates = [] | |
| while soulmates.length < 10 | |
| # get 10 candidates for Buffy | |
| (userids) <- getMatches buffy, 10, * | |
| for u, i in userids |
This file contains hidden or 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
| {resolve} = require "dns" | |
| do_one = (host, cb) -> | |
| (err, ip) <- resolve host, "A", * | |
| console.log if err then "ERROR! #{err}" else "#{host} -> #{ip}" | |
| cb() if typeof cb is 'function' | |
| do_all = (hosts) -> | |
| defer | |
| for host, i in hosts |
This file contains hidden or 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 Datalog where | |
| import Data.List | |
| type Predicate = String | |
| type Variable = String | |
| data Rule | |
| = Rule [Atom] | |
| deriving (Eq) |
This file contains hidden or 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
| Copyright (c) 2011, Michael Ficarra | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright notice, this | |
| list of conditions and the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright notice, | |
| this list of conditions and the following disclaimer in the documentation | |
| and/or other materials provided with the distribution. |
This file contains hidden or 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
| # Login access control table. | |
| # | |
| # Comment line must start with "#", no space at front. | |
| # Order of lines is important. | |
| # | |
| # When someone logs in, the table is scanned for the first entry that | |
| # matches the (user, host) combination, or, in case of non-networked | |
| # logins, the first entry that matches the (user, tty) combination. The | |
| # permissions field of that table entry determines whether the login will | |
| # be accepted or refused. |
This file contains hidden or 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 | |
| yum=/usr/bin/yum | |
| "$yum" check-update &> /dev/null | |
| [ 0 -eq $? ] && exit 0 | |
| "$yum" -y -e 0 -R 10 update yum &> /dev/null | |
| updated=`"$yum" -y -e 0 -R 120 --skip-broken update 2>&1` | |
| num_updated=`echo "$updated" \ | |
| | grep -ix "Upgrade\\s\+[0-9]\+\\s\+Package(s)" \ | |
| | sed -e 's/Upgrade\s\+\([0-9]\+\)\s\+Package(s)/\1/'` | |
| packages=packages |
This file contains hidden or 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 | |
| running_kernel=`uname -r` | |
| latest_kernel=`rpm -q kernel | tail -n1 | sed -e 's/kernel-//'` | |
| [ "$running_kernel" = "$latest_kernel" ] && exit 0 | |
| echo "Running Kernel is $running_kernel but latest installed kernel\ | |
| is $latest_kernel. This machine should be rebooted." \ | |
| | mail -s "$(hostname): reboot required" root |
This file contains hidden or 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
| LIBEVENT_CFLAGS="-I/usr/local/include" LIBEVENT_LIBS="-L/usr/local/lib -levent" ./configure && make && sudo make install && sudo service transmission-daemon restart |
This file contains hidden or 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 'etsy' | |
| Etsy.api_key = '<api-key>' | |
| shop = Etsy::Shop.find '<shop-name>' | |
| out_dir = '<output-directory>' | |
| Etsy.environment = :production | |
| Dir.mkdir out_dir unless File.exists? out_dir | |
| listings = [] |
This file contains hidden or 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
| // Authors: | |
| // Michael Ficarra <github.com/michaelficarra> | |
| register({ | |
| name: 'Gravatar', | |
| url: 'http://gravatar.com/emails', | |
| domains: [ 'gravatar.com' ], | |
| sessionCookieNames: [ 'gravatar' ], | |
| identifyUser: function() { |