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
# Example to initialize gridster and handle resizing | |
# Module grid settings | |
WIDGET_BASE_DIMENSIONS_X = WIDGET_DESKTOP_X = 140 | |
WIDGET_BASE_DIMENSIONS_Y = 20 | |
WIDGET_CONTAINER_SELECTOR = '.widget-view' | |
WIDGET_MOBILE_CUTOFF_WIDTH = 768 | |
NUM_WIDGETS = 15 | |
$ -> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST | |
1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.beeftornado.ipfw</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/bin/ipfwstartup.sh</string> |
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 ruby | |
# Modified version of https://github.com/geebee/tmux-persistence to work with byobu | |
# and work on OSX. | |
require 'fileutils.rb' | |
# Start - Configuration Variables | |
sessionDir = ENV['HOME']+"/.byobu-sessions" | |
maxStoredSessions = 5 |
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
# # Broken Socket | |
""" A broken socket implementation. | |
Credits: | |
* [A. Jesse Jiryu Davis](http://emptysqua.re/blog/undoing-gevents-monkey-patching/) | |
Monkey patches the built in socket implmentation so that various exceptions are | |
raised. Useful for running unit tests to validate behavior when connections |
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
""" | |
Assuming you have this lovely gem somewhere else in your app from the old days | |
..sourcecode:: python | |
import urllib2 | |
mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() | |
for name, creds in services.items(): # dict of tuples: {name: (uri, user, pass)} | |
mgr.add_password(None, *creds) |
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 public(f): | |
''' | |
Decorator used to assign the attribute __public__ to methods. | |
''' | |
f.__public__ = True | |
return f | |
class Protected(object): | |
''' | |
Base class of all classes that want to hide protected attributes from |
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
# -*- coding: utf-8 -*- | |
# # Site API | |
# ## Imports | |
# Standard libs | |
# Third party libs | |
import bottle | |
from bottle import get, post, route |
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
# Install to /usr/local/Library/Homebrew/cmd/rmtree.rb | |
require 'keg' | |
require 'formula' | |
require 'shellwords' | |
module Homebrew | |
def rmtree | |
raise KegUnspecifiedError if ARGV.named.empty? |
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
class SophosAntiVirusHomeEdition91 < Cask | |
module Utils | |
@@services = nil | |
def self.disable_sophos_services | |
# Stop any existing sophos or the install could hang | |
# Maybe it was only the permissions issue and not existing sophos, double check if needed | |
cmd = ['/usr/bin/sudo', '-E', '--', '/bin/launchctl', 'list'].join(' ') | |
@@services = `#{cmd}` | |
@@services.split.find_all{ |service| service.include? 'com.sophos' }.each do |service| | |
ohai "Stopping service #{service}..." |
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
server { | |
listen 80; ## listen for ipv4; this line is default and implied | |
listen [::]:80 default ipv6only=on; ## listen for ipv6 | |
root /usr/share/nginx/www; | |
index index.php index.html index.htm; | |
# Make site accessible from http://localhost/ | |
server_name _; |
OlderNewer