Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require 'alchemy_api'
require 'json'
require 'pry'
AlchemyAPI.key = "bfc9f1c85f548d2ee9272e49ad3866f0e663cef1"
file = File.open("json.txt")
c = file.read
c = c.scan(/[[:print:]]/).join
require 'rubygems'
require 'watir-webdriver'
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 3000 # seconds – default is 60
b = Watir::Browser.new :firefox, :http_client => client
b.goto 'http://www.android-permissions.org/'
#put your directory here
@jontonsoup
jontonsoup / gist:4983253
Created February 19, 2013 05:05
checks the security of a directory full of apks
require 'rubygems'
require 'watir-webdriver'
b = Watir::Browser.start 'http://www.android-permissions.org/'
#put your directory here
entries = Dir.entries("/Users/Jonathan/Desktop/a")
entries.each do |entry|
b.goto("http://www.android-permissions.org/")
.nav-mobile.clearfix
/ touching this button shows search bar
.navbarbutton.searchbtn.left{:onclick => "$('#search-box,#mobile-search').toggle(500);"}
%img{:src => asset_path("btn-search-mobile.png")}
%a.navbartitle{:href => "/"}
#nav-tab-bar
.tab-bar-left-cap
.tab-bar-center
#tab-bar-items
%a.item{:href => "/"}
desc "Renames all .html.erb files to .html.haml"
task :haml do
print "looking for erb views..\n"
files = `find ./app/views -name *.html.erb`
files.each_line do |file|
file.strip!
print "parsing file: #{file}\n"
`mv #{file} #{file.gsub(/\.erb$/, ".haml")}`
end
end
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/*
Author: Cynthia Stamelos
Date: 1/28/13
t.c: In function ‘function2’:
#include <stdio.h>
int main()
{
function1(1);
function2();
return 0;
}
require 'watir-webdriver'
b = Watir::Browser.new
b.goto 'facebook.com'
b.text_field(:id => 'email').set ''
b.text_field(:id => 'pass').set ''
b.button(:value => 'Log In').click
while(true) do
b.text_field(:name => 'xhpc_message').click
b.text_field(:name => 'xhpc_message_text').set '@northwestern ski trip'
02 This is a turkey:
03
04 ,+*^^*+___+++_
05 ,*^^^^ )
06 _+* ^**+_
07 +^ _ _++*+_+++_, )
08 _+^^*+_ ( ,+*^ ^ \+_ )
09 { ) ( ,( ,_+--+--, ^) ^\
10 { (@) } f ,( ,+-^ __*_*_ ^^\_ ^\ )
11 {:;-/ (_+*-+^^^^^+*+*<_ _++_)_ ) ) /
get_covar_all.pl: ($count, $mean_f1,$std_f1, $mean_f2, $std_f2) = ExecStockSQL("ROW",$sql);
get_covar_all.pl: ($covar{$s1}{$s2}) = ExecStockSQL("ROW",$sql);
get_covar.pl: ($count, $mean_f1,$std_f1, $mean_f2, $std_f2) = ExecStockSQL("ROW",$sql);
get_covar.pl: ($covar{$s1}{$s2}) = ExecStockSQL("ROW",$sql);
get_data_for_predict.pl:my $data = ExecStockSQL("TEXT",$sql);
get_data_for_strat.pl:my $data = ExecStockSQL("TEXT",$sql);
get_data.pl:my $data = ExecStockSQL("TEXT",$sql);
get_info_beta.pl: $beta = ExecStockSQL("ROW",$sql2);
get_info_cvb.pl: ($n,$mean,$std,$min,$max) = ExecStockSQL("ROW",$sql);
get_info_cvb.pl: #$beta = ExecStockSQL("ROW",$sql2);