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
Faye.extend(Faye.Engine.Redis.prototype, { | |
subscribe: function(clientId, channel, callback, scope) { | |
var current_key, self; | |
self = this; | |
this._redis.sadd(this._ns + '/clients/' + clientId + '/channels', channel, function(error, added) { | |
if (added === 1) return self.trigger('subscribe', clientId, channel); | |
}); | |
this._redis.sadd(this._ns + '/channels' + channel, clientId, function() { | |
self.debug('Subscribed client ? to channel ?', clientId, channel); |
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
!!! | |
%html | |
%head | |
%title ElectionsoftServer | |
= stylesheet_link_tag "application", :media => "all" | |
= javascript_include_tag "application" | |
= csrf_meta_tags | |
%body | |
%p.notice | |
= notice |
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
$.extend($.ui.multiAccordion, { | |
// private helper method that used to show tabs | |
_showTab: function($this) { | |
var $span = $this.children('span.ui-icon'); | |
var $div = $this.next(); | |
var options = this.options; | |
$this.removeClass('ui-state-default ui-corner-all').addClass('ui-state-active ui-corner-top'); | |
$span.removeClass('ui-icon-triangle-1-e').addClass('ui-icon-triangle-1-s'); | |
// MODIIFICATION | |
bindThis = this; |
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
/****************************************************************************** | |
* Half Duplex Software UART on the LaunchPad | |
* | |
* Description: This code provides a simple Bi-Directional Half Duplex | |
* Software UART. The timing is dependant on SMCLK, which | |
* is set to 1MHz. The transmit function is based off of | |
* the example code provided by TI with the LaunchPad. | |
* This code was originally created for "NJC's MSP430 | |
* LaunchPad Blog". | |
* |
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 | |
# | |
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156) | |
# | |
# ## Advisory | |
# | |
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion | |
# | |
# ## Caveats | |
# |
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
package com.xxx.xxx.preference; | |
import java.text.DateFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Locale; | |
import android.content.Context; | |
import android.content.res.TypedArray; |
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
# you can make a text file of request times (in ms, one number per line) and import it here, or you can use a probability distribution to simulate request times (see below where setting req_durations_in_ms) | |
# rq = read.table("~/Downloads/request_times.txt", header=FALSE)$V1 | |
# argument notes: | |
# parallel_router_count is only relevant if router_mode is set to "intelligent" | |
# choice_of_two, power_of_two, and unicorn_workers_per_dyno are only relevant if router_mode is set to "naive" | |
# you can only select one of choice_of_two, power_of_two, and unicorn_workers_per_dyno | |
run_simulation = function(router_mode = "naive", | |
reqs_per_minute = 9000, |
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
namespace :deploy do | |
desc "Hot-reload God configuration for the Resque worker" | |
task :reload_god_config do | |
sudo "god stop resque" | |
sudo "god load #{File.join(deploy_to, 'current', 'config', 'resque-' + rails_env + '.god')}" | |
sudo "god start resque" | |
end | |
end | |
# append to the bottom: |
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
/** | |
* | |
*/ | |
package com.nickaknudson.android.animations; | |
import com.nickaknudson.mva.callbacks.Callback; | |
import android.view.animation.Animation; | |
import android.view.animation.Transformation; |
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
for i in *@2x.*; do mv "$i" "${i/@2x/}"; done; |
OlderNewer