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
module CarrierWave | |
module Storage | |
class S3 | |
class File | |
def store(file) | |
content_type ||= file.content_type # this might cause problems if content type changes between read and upload (unlikely) | |
connection.put_object(bucket, path, file.open, | |
{ | |
'x-amz-acl' => access_policy.to_s.gsub('_', '-'), |
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/python | |
from numpy import * | |
import sys | |
from datetime import datetime | |
my_array = [] | |
array_size = 640*480*3*3 | |
a = datetime.now() |
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
# app/models/ability.rb | |
# All front end users are authorized using this class | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new | |
can :read, :all |
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
# Remove everything from the index | |
git rm --cached -r . | |
# Re-add all the deleted files to the index | |
# You should get lots of messages like: "warning: CRLF will be replaced by LF in <file>." | |
git diff --cached --name-only -z | xargs -0 git add | |
# Commit | |
git commit -m "Fix CRLF" |
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
- content_for :sidebar do | |
= render_widget :contract_summary, :display, @contract, true | |
- content_for :extra_header_row do | |
- unless @hide_edit_link | |
.price-offset.breadcrumb | |
span = "Go to " | |
= link_to *@link_to | |
- content_for :content do | |
- Contract.filtered_categories.each do |category| | |
- config_set = @category_details[category.name][:config_set] |
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
brew doctor | |
Your system is raring to brew. |
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
Your system is raring to brew. |
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
"jruby-rack-worker#1" daemon prio=10 tid=0x00007f4a8ce3d000 nid=0x3c08 runnable [0x00007f4a4f042000] | |
java.lang.Thread.State: RUNNABLE | |
at sun.nio.ch.NativeThread.current(Native Method) | |
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:325) | |
- locked <0x000000075a084f68> (a java.lang.Object) | |
- locked <0x000000075a084f48> (a java.lang.Object) | |
at org.jruby.ext.openssl.SSLSocket.readAndUnwrap(SSLSocket.java:513) | |
at org.jruby.ext.openssl.SSLSocket.read(SSLSocket.java:501) | |
at org.jruby.ext.openssl.SSLSocket.do_sysread(SSLSocket.java:613) | |
at org.jruby.ext.openssl.SSLSocket.sysread_nonblock(SSLSocket.java:636) |
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
# requires socksify gem | |
require "socksify" | |
require 'socksify/http' | |
# use w/ OAuth2 like OAuth2::Client.new(id, secret, connection_opts: { proxy: 'socks://127.0.0.1:9050' }) | |
class Faraday::Adapter::NetHttp | |
def net_http_connection(env) | |
if proxy = env[:request][:proxy] | |
if proxy[:uri].scheme == 'socks' | |
Net::HTTP.SOCKSProxy(proxy[:uri].host, proxy[:uri].port) |
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
@page { | |
size: 8.5in 11in landscape; | |
margin: 1cm; | |
} | |
table { | |
background: #ff8244; | |
} | |
.half-image { |
OlderNewer