Skip to content

Instantly share code, notes, and snippets.

View theskillwithin's full-sized avatar
😝
yay

Austin Peterson theskillwithin

😝
yay
View GitHub Profile
@theskillwithin
theskillwithin / highlightCurrentNavItem.js
Created April 5, 2016 22:46
on a one page site this can be used to highlight the nav item of the current page.
var highlightCurrentNavItem {
hrefId: [];
current: var;
getEachNavItem: function() {
$('nav li a').each(function() {
var that = $(this);
hrefId.push(that.attr('href'));
});
},
Scroll: function() {
$(document).ready(function() {
var hrefId = [];
$('#fixed-nav li a').each(function() {
var that = $(this);
hrefId.push(that.attr('href'));
});
$('#fixed-nav a[href$=#home]').css('color','red');
$('.topbarbg').css('opacity', '1');
var current;
$(document).scroll(function() {
var highlightCurrentNavItem = {
getEachNavItem: function() {
hrefId: [];
$('nav li a').each(function() {
var that = $(this);
highlightCurrentNavItem.hrefId.push(that.attr('href'));
});
},
scroll: function() {
var current;
<?php
function Amazon($ASIN) {
//$this->_ASIN = $ASIN;
$url = "http://www.amazon.com/dp/" . $ASIN;
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// grab URL and pass it to the browser
<?php
include('aws_signed_request.php');
function init() { //get the amazon process output
$row = 1;
if (($handle = fopen("proccess.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, "\t")) !== FALSE) {
$num = count($data);
//echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
@theskillwithin
theskillwithin / README.md
Created April 17, 2016 00:12
comparing two CSV files and combining them.

CSV-File-Compare

Compares a csv file against a text file to quickly find the cost of a free gift report

cvsfilecompare.php will read a file called test.csv which is a report generaed from a Magento site.

This is used to determine the cost of "free gifts" which are coupon codes in Magento that give you a gift item at checkout.

{
"name": "Heartcup",
"description": "Heartcup",
"main": "gulp.config.js",
"authors": [
"Brandastic"
],
"license": "",
"moduleType": [],
"homepage": "",
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@theskillwithin
theskillwithin / package.json
Created September 22, 2016 21:05
npm-scripts
{
"name": "heartcup",
"version": "1.2.0",
"description": "hearcup.",
"keywords": [
"npm",
"scripts",
"npm scripts",
"watch",
"minify",
@theskillwithin
theskillwithin / css.scpt
Created September 30, 2016 22:11
textual://custom-scripts-folder
on textualcmd(inputText, selectedChannel)
if inputText is equal to "flexbox" then
return "https://css-tricks.com/snippets/css/a-guide-to-flexbox/ --- https://youtu.be/G7EIAgfkhmg --- https://youtu.be/qpdxiIDzg6Q"
else if inputText is equal to "cp" then
return "codepen.io"
else
return "/debug Help commands: message1, message2"
end if
end textualcmd