This file contains hidden or 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
openssl genrsa -des3 -out privkey.pem 2048 | |
openssl rsa -in privkey.pem -outform PEM -pubout -out pubkey.pem |
This file contains hidden or 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
require 'openssl' | |
require 'base64' | |
private_key_file = 'privkey.pem'; | |
password = 'this phrase is the clue to unlock the encryption' | |
encrypted_string = "" | |
File.open(ARGV[0]).each_line do |line| | |
encrypted_string += line |
This file contains hidden or 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
require 'openssl' | |
require 'base64' | |
public_key_file = 'pubkey.pem'; | |
string = "" | |
File.open(ARGV[0]).each_line do |line| | |
string += line | |
end |
This file contains hidden or 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
before_filter :store_location | |
def store_location | |
# store last url - this is needed for post-login redirect to whatever the user last visited. | |
return unless request.get? | |
if ( !request.path.include?("/log-in") && | |
!request.path.include?("/users/confirmation") && | |
!request.path.include?("/users/password/new") && | |
!request.path.include?("/users/password/edit") && | |
!request.xhr?) # don't store ajax calls |
This file contains hidden or 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
JS_PATH = "app/assets/javascripts/**/*.js"; | |
Dir[JS_PATH].each do |file_name| | |
puts "\n#{file_name}" | |
puts Uglifier.compile(File.read(file_name)) | |
end |
This file contains hidden or 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 :figaro do | |
desc "Symlink application.yml to the release path" | |
task :symlink do | |
on roles :all do | |
execute :ln, "-sf #{shared_path}/application.yml #{release_path}/config/application.yml" | |
end | |
end | |
end |
This file contains hidden or 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
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.support.ui import Select | |
from selenium.common.exceptions import NoSuchElementException | |
import unittest, time, re, sys | |
filepath = sys.argv[1] | |
class Openlinksinfile(unittest.TestCase): |
This file contains hidden or 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
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.support.ui import Select | |
from selenium.common.exceptions import NoSuchElementException | |
import unittest, time, re, sys | |
baseurl = sys.argv[1] | |
class Clickalllinksonpage(unittest.TestCase): |
This file contains hidden or 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
//connects and reads from usb device | |
public class PollUSBActivity extends Activity implements View.OnClickListener { | |
private static final String TAG = "USBReader"; | |
private TextView mLog; | |
private UsbManager mUsbManager; | |
private UsbDevice mDevice; |
This file contains hidden or 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 DeviseHelper | |
def devise_error_messages! | |
return "" if resource.errors.empty? | |
messages = resource.errors.full_messages.map { |msg| | |
content_tag :li do | |
content_tag(:div, ' ', :class=>'glyphicon glyphicon-exclamation-sign') + | |
content_tag(:span, ' '+msg) | |
end | |
}.join |
NewerOlder