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
RewriteCond %{HTTPS} !=on | |
RewriteCond %{HTTP_HOST} ^<HOST>.com$ [NC] | |
RewriteRule ^(.*)$ http://www.<HOST>.com/$1 [L,R=301] | |
RewriteCond %{HTTPS} =on | |
RewriteCond %{HTTP_HOST} ^<HOST>.com$ [NC] | |
RewriteRule ^(.*)$ https://www.<HOST>.com/$1 [L,R=301] |
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
# Find files over 300kb and resize to 300kb | |
identify -format '%b %h %i\n' ./*.png | | |
awk '$1 > 300000 {sub(/^[^ ]* [^ ]* /, ""); print}' | | |
tr '\n' '\0' | | |
xargs -0 mogrify -define png:extent=300KB | |
# Find files over 600px width and resize to 600px while keeping ratio | |
identify -format '%w %h %i\n' ./*.png | |
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 'nokogiri' | |
require 'open-uri' | |
require 'mongo' | |
x = true | |
while x | |
content = "" | |
puts "enter site" | |
site = gets.chomp |
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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> | |
<script> | |
var requestUrl = ""; | |
window.onload = function() { | |
$.getJSON(requestUrl, {}, function (data) { | |
document.write(JSON.stringify(data)); | |
console.log(data); | |
}).error( | |
function(jqXHR, statusText, errorThrown) { | |
alert(jqXHR.status); |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<!--[if !mso]><!--> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<!--<![endif]--> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title></title> | |
<link rel="stylesheet" type="text/css" href="styles.css"> |
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 "json" | |
require "pry" | |
file_raw = File.read("./keywords.json") | |
file = JSON.parse(file_raw) | |
counter = 1 | |
file["results"]["Keywords"].each_with_index do |keyword, index| | |
file["results"]["Keywords"][index] = { keyword["url"].split('/'[-1]).last => keyword } | |
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
def twitter_data | |
[{"LaunchAcademy_"=> | |
{"description"=> | |
"A 10 week, intensive bootcamp teaching you how to code with a focus on Ruby on Rails", | |
"last twenty tweets"=> | |
["RT @chrisccerami: While learning web development I created a map of all of the shows @Screamales have played and damn @DonGiovanniRecs http…", | |
"6 ways to quantify your code and why you need to do it: http://t.co/1WKtpo41tP by @kevinrcasey http://t.co/lulzPLTY8c", | |
"Do more of what you want at work. How to create productive partnerships: http://t.co/QpYpHhHEid by @benvoss", | |
"RT @Pistachio: SO rad. bunch of local women learning to code with @gdiBoston at @HubSpot right now: http://t.co/jaIxK7suOj", | |
"RT @STWatkins78: Huge breakthrough on my breakable toy today...can upload local file to soundcloud from my app...time for a beer! #LaunchAc…", |
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
<?xml version="1.0"?> | |
<root> | |
<!-- Google Chrome --> | |
<vkopenurldef> | |
<name>KeyCode::VK_OPEN_URL_APP_Chrome</name> | |
<url type="file">/Applications/Google Chrome.app</url> | |
</vkopenurldef> | |
<!-- Atom --> |
NewerOlder