Skip to content

Instantly share code, notes, and snippets.

View akinsgre's full-sized avatar

Greg Akins akinsgre

View GitHub Profile
RMAN> run {
2> set until time "to_date('05/09/2013 06:10', 'MM/DD/YYYY HH:MI')";
3> restore database;
4> recover database ;
5> }
executing command: SET until clause
Starting restore at 11-MAY-13
using target database control file instead of recovery catalog
private static InputStream addPrintCharTo(byte[] bArr)
throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
out.write(INIT);
// out.write(CONDENSED);
// out.write(PICA);
out.write(new Byte((byte) 0x21));
// out.write(new Byte((byte) 1));
for (int i = 0; i<bArr.length; i++) {
out.write(new byte[]{bArr[i]}, 0, 1) ;
<div class="modal-body">
<div class="head-part">
<h2 class="title"></h2>
</div><!-- .head-part -->
<div class="body-part">
<form>
<div class="options">
<div class="part">
$("#configure_configuration_div")
.load('/devices/<%= @device.id %>/configurations/new',
function() {
$(this).css({height:'auto' });
followForm();
});
@akinsgre
akinsgre / config.txt
Created November 8, 2012 14:30
Example of setting maxmemory.. confusing for me.
$ ./redis-cli
redis> set x 10
OK
redis> config set maxmemory 200
OK
redis> set y 20
(error) ERR command not allowed when used memory > 'maxmemory'
redis> config set maxmemory 0
OK
redis> set y 20
@akinsgre
akinsgre / controller.rb
Created September 13, 2012 15:17
Type error
def update
@channel = current_user.channels.find(params[:id])
# make sure channel isn't social
#render :text => '' and return if @channel.social
if params["channel"]["video_type"].blank? && !params["channel"]["video_id"].blank?
@channel.errors.add(:base, t(:channel_video_type_blank))
end
if @channel.errors.count <= 0
puts "########## Params #{params.inspect}"
@channel.save_tags(params[:tags][:name])
@akinsgre
akinsgre / plugin.rb
Created July 30, 2012 12:45
Dependent delete on relate_to_details
class Plugin < ActiveRecord::Base
belongs_to :user
has_one :plugin_window_detail, :dependent => :delete
def private?
private_flag?
end
end
@akinsgre
akinsgre / output.txt
Created July 27, 2012 12:26
Helper methods not called synchronously
Started GET "/plugins/1" for 127.0.0.1 at 2012-07-27 08:12:13 -0400
Processing by PluginsController#show as HTML
Parameters: {"id"=>"1"}
Plugin Load (0.1ms) SELECT `plugins`.* FROM `plugins` WHERE `plugins`.`id` = 1 LIMIT 1
Rendered plugins/show.html.erb (0.3ms)
Completed 200 OK in 110ms (Views: 2.2ms | ActiveRecord: 0.1ms)
Private User
@akinsgre
akinsgre / controller.rb
Created March 13, 2012 14:29
Problem with ActiveRecord save/update
def update
@channel = Channel.find(params[:channel_id])
@status = 0
# check permissions
if @channel.user_id == current_user.id
# save data
@channel.options1 = params[:options]
logger.debug "Channel changes " + @channel.changes.to_s
if @channel.save
<div id="channel_info">
<div style="clear:both"/>
<div id="dialog0" class="column" > </div>
<div id="dialog1" class="column" > </div>
</div>
<div style="clear:both"></div>