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
<?php | |
// WARNING | |
// This code should NOT be used as is. It is vulnerable to path traversal. https://www.owasp.org/index.php/Path_Traversal | |
// You should sanitize $_GET['directtozip'] | |
// For tips to get started see http://stackoverflow.com/questions/4205141/preventing-directory-traversal-in-php-but-allowing-paths | |
//Get the directory to zip | |
$filename_no_ext= $_GET['directtozip']; | |
// we deliver a zip file |
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
sponsoredItems = [] | |
for i in data.xpath('ffed_item) | |
sponsored = i.xpath("div/span[@class='label--sponsored']") | |
if sponsored is not None: | |
sponsoredItems = sponsoredItems.append(i) | |
print(sponsoredItems) |
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
<?php | |
//MediaSilo Information | |
$server = "upload.mediasilo.com"; | |
$ftp_user_name = "YOUR MEDIASILO LOGIN NAME AND HOSTNAME(e.g NAMEHOSTNAME"; | |
$ftp_user_pass = "YOUR MEDIASILO LOGIN PASSWORD"; | |
$dest = "THE WORKSPACE YOU WANT TO UPLOAD TO"; | |
//Video Folder Information | |
$source_folder = "FULL PATH TO FOLDER. NO TRAILING SLASH (e.g. /var/www/videofolder)"; | |
//Grabs everything in the source folder. You may want to set a file type like, ($source_folder."/*.flv") |
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
require 'sendgrid-ruby' | |
include SendGrid | |
require 'json' | |
html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title></head><body> | |
<div> | |
<br> | |
<%CONTACT_SYNC_HASH%> |
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
<?php | |
//Get the directory to zip | |
$filename_no_ext= $_GET['directtozip']; | |
// we deliver a zip file | |
header("Content-Type: archive/zip"); | |
// filename for the browser to save the zip file | |
header("Content-Disposition: attachment; filename=$filename_no_ext".".zip"); |
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
<?php | |
if ( is_page('about')) { | |
echo '<div id="secondnav">This is the super cool secondary navigation.</div>'; | |
} | |
?> |
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
params[:document][:filearrays].each do |file| | |
@document = Document.new(:document => file) | |
@document.save | |
end |
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 upgrade `brew outdated | awk {'print $1'} | xargs` |
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
<?php | |
function add_to_index() { | |
$projects = $this->Project->find('all'); | |
foreach($projects as $project){ | |
$indexData = array('text'=>$project['Project']['title'],'title'=>$project['Project']['title'],'description'=>$project['Project']['description'],'user_id'=>$project['Project']['user_id']); | |
$id = $project['Project']['_id']; | |
$this->addIndextank("HomkoraProjects",$id,$indexData); |
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
<script src="http://your-juggernaut-app.herokuapp.com/application.js" type="text/javascript" charset="utf-8"></script> |
NewerOlder