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
jQuery -> | |
$('#counselor_supervisor_employee_position_id').hide() | |
position = $('#counselor_supervisor_employee_position_id').html() | |
$('#counselor_supervisor_employee_department_id').change -> | |
department = $('#counselor_supervisor_employee_department_id :selected').text() | |
escaped_department = department.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1') | |
options = $(position).filter("optgroup[label='#{escaped_department}']").html() | |
if options | |
$('#counselor_supervisor_employee_position_id').html(options) | |
$('#counselor_supervisor_employee_position_id').show() |
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
first_day = Ticket.minimum(:created_at).to_date | |
last_day = Ticket.maximum(:created_at).to_date | |
all_tickets = Ticket.all # or Ticket.where(created_at: <from>..<to>) | |
count_by_day = (first_day..last_day).map do |day| | |
[ day, all_tickets.select{|t| t.created_at.to_date == day }.count ] | |
end | |
hash_version = Hash[ count_by_day ] |
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 PostgreSQL 9 in Mac OSX via Homebrew | |
Mac OS X Snow Leopard | |
System Version: Mac OS X 10.6.5 | |
Kernel Version: Darwin 10.5.0 | |
Install notes for PostgreSQL 9.0.1 install using Homebrew: | |
sh-3.2# brew install postgresql |
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
# unicorn_rails -c /srv/myapp/current/config/unicorn.rb -E production -D | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
working_directory (rails_env == 'production' ? "/srv/myapp/current" : `pwd`.gsub("\n", "")) | |
worker_processes (rails_env == 'production' ? 10 : 4) | |
preload_app true | |
timeout 30 | |
if rails_env == 'production' |
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
// By Bassam Netros | |
// This is an old code and needs more ... | |
using System; | |
using System.Windows.Forms; | |
namespace WirlessAutoConnect | |
{ | |
public class Connector | |
{ | |
public Connector() |
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
<contents of normal file> | |
# Add any additional locations to look for master runners | |
runner_dirs: [/srv/runners] | |
# Register a reactor whenever a cloud provider emits 'created' | |
# the * is the name of the VM, we want any, but you could | |
# do something like salt/cloud/Webservers-*/created if you only | |
# wanted your webservers | |
reactor: |
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 | |
# based on script from http://www.axllent.org/docs/view/ssh-geoip | |
# License: WTFPL | |
# UPPERCASE space-separated country codes to ACCEPT | |
ALLOW_COUNTRIES="DE EU GB" | |
LOGDENY_FACILITY="authpriv.notice" | |
if [ $# -ne 1 ]; then | |
echo "Usage: `basename $0` <ip>" 1>&2 |
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/sh | |
# This is a skeleton of a bash daemon. To use for yourself, just set the | |
# daemonName variable and then enter in the commands to run in the doCommands | |
# function. Modify the variables just below to fit your preference. | |
daemonName="DAEMON-NAME" | |
pidDir="." | |
pidFile="$pidDir/$daemonName.pid" |
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
# This file has been modified by Eli Dickinson to update detection rules and to | |
# send a Vary header downstream. It has also been updated to | |
# work with newer versions of Varnish. | |
# | |
# A simple mobile device detection implementation in VCL | |
# http://fangel.github.com/mobile-detection-varnish-drupal | |
# | |
# The file is based upon initial work done by Audun Ytterdal, which can be |
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
# This file has been modified by Eli Dickinson to update detection rules and to | |
# send a Vary header downstream. It has also been updated to | |
# work with newer versions of Varnish. | |
# | |
# A simple mobile device detection implementation in VCL | |
# http://fangel.github.com/mobile-detection-varnish-drupal | |
# | |
# The file is based upon initial work done by Audun Ytterdal, which can be |
OlderNewer