I hereby claim:
- I am michaelfward on github.
- I am anemos (https://keybase.io/anemos) on keybase.
- I have a public key ASBpukXG_MkyzHZzGw3d5mgdjcgkvsn0JG9ehzFdpXlaBgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
from selenium.webdriver import PhantomJS, DesiredCapabilities | |
from selenium.webdriver.remote.remote_connection import RemoteConnection as Remote | |
from selenium.webdriver.phantomjs.service import Service | |
from selenium.webdriver.remote.command import Command | |
import warnings | |
from selenium.webdriver.remote.webdriver import WebDriver as _RemoteWebDriver | |
class PhantomCommands(Command): |
A Pen by Michael Ward on CodePen.
I hereby claim:
To claim this, I am signing this object:
function generateAccessToken(callback){ | |
var requestUrl = 'https://graph.facebook.com/oauth/access_token?client_id='+keys.facebook.appID+'&client_secret='+keys.facebook.secret+'&grant_type=client_credentials'; | |
https.get(requestUrl, function(response){ | |
response.on('data', function(data){ | |
var token = data.toString('utf-8').split("access_token="); | |
FacebookClient.setAccessToken(token[1]); | |
callback(); | |
}); | |
}).on('error', function(error){ |
def get_html file | |
regex = /.*(media.*\.jpg)/ | |
fd = File.open("./img/#{file}", "r") | |
fd.each_line do |line| | |
if (regex =~ line) == 0 | |
data = Regexp.last_match | |
puts data[1] | |
end | |
end |
#!/bin/usr/ruby | |
#reads a file and parses into a single string declaration in language of choice | |
#another little snippet to make my job easier when writing lots of code | |
#programmed by michael ward | |
# [email protected] | gists.github.com/michaelfward | |
# *************************************** | |
# example scrips | |
# with readfiles |
#programmed by michael ward | |
#[email protected] | |
def adjustline(line, off) | |
str = "" | |
1.upto(off) {|x| str << " "} | |
str << line | |
str | |
end |
#!/bin/ruby | |
def getfile(path) | |
content = [] | |
content[0] = "from: #{path}\n\n\n" #hopefully makes the output easier to read | |
fd = File.open(path.chomp, "r") | |
fd.each_line {|x| content.push(x)} | |
content.push("\n\n") | |
$destination_output.push(content) | |
puts "successfully got #{path}" |
#coded by michael ward | |
#i wrote a bunch of client facing code to render different stuffs | |
#and decided to write all the javascript functions later and | |
#only focus on the CSS and HTML, and i realized it was a pain | |
#to go and get all the functions i needed to write, etc... so.. | |
#voila | |
#*-------------------------------------------------* | |
#i want to port it to be able to take 1/2 argument * | |
#that would either a) read dirs for all html files * |