Skip to content

Instantly share code, notes, and snippets.

View jaseclamp's full-sized avatar

Jase Clamp jaseclamp

  • Brisbane, Australia
View GitHub Profile
<?php
$sites = "http://www.broadcastsolutions.com.au/
http://www.kvm.com.au/
http://www.ambertech.com.au/";
$sites = preg_split('/\r\n|\r|\n/', $sites);
echo "
@jaseclamp
jaseclamp / warm_varnish
Created February 18, 2015 04:56
Warm Varnish Cache
#!/bin/bash
# this script will
# a. crawl the designated site X levels deep to generate a urls list
# b. completely purge all urls on the desisgnated varnish servers for the designated url
# c. clear cache on nginx / mod pagespeed for the designated app servers
# d. individually warm all the listed urls on each designated varnish server
# e. rewarm them in case pagespeed sent a purge request
# define some variables
@jaseclamp
jaseclamp / linkedin-loop.js
Last active August 29, 2019 07:11
meetup linkedin search
/*
INSTRUCTIONS
1. Open this file in notepad or something similar
2. Paste your list of names where it says replace names
3. Go to linkedin and line up a people search for your city
4. In google chrome. In Windows and Linux hit: Ctrl + Shift + J. On Mac hit: Cmd + Option + J.
5. Copy paste this whole script in to the console and hit enter
6. leave the window active while it collects results
7. You should get a tab seperated CSV that you can open in Excel
@jaseclamp
jaseclamp / linkedin.js
Last active August 26, 2019 06:32
linkedin search results pager
/*
what this script does:
it pages through linkedin search results and copies names, images, company, location, position into a javascript array
once it reaches the end of the results it will prompt to download all the names as a tab delimited csv.
to use:
go to linkedin, run a search exactly how you want it
go to page 2 of those results
paste the below script into console and hit enter
paste this line into console to enable the script:
@jaseclamp
jaseclamp / scrape-nrf.js
Created January 11, 2018 05:26
Run in browser console to scrape exhibitor list found at https://nrfbigshow.nrf.com/exhibitors
function tabValues(array) {
var keys = Object.keys(array[0]);
var result = keys.join("\t") + "\n";
array.forEach(function(obj){
keys.forEach(function(k, ix){
if (ix) result += "\t";
@jaseclamp
jaseclamp / pinnaclecart2magento-phase2.php
Created April 15, 2013 05:55
Migrates data from Pinnacle Cart to Magento. Put this script in your Magento root and edit DB connection details to point to Pinnacle Cart site. This is script 2 of 3.
<?php
//Migrate data from Pinnacle Cart to Magento Part TWO
require_once 'app/Mage.php';
Mage::app(0); // best to leave as default as prods are created in admin and you can apply to stores as needed
include_once('simple_html_dom.php');
include_once('import-filter.php');
@jaseclamp
jaseclamp / cleanse_deleted_jira_issues_from_stitch.php
Last active March 31, 2017 05:19
Stitch data does not delete issues from postgres sql when issues are deleted from jira. This script cleans that up.
<?php
//REPLACE ALL XXX !!
// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Content-Type: application/json\r\nAuthorization: Basic " . base64_encode("xxx:xxx")
)
@jaseclamp
jaseclamp / acc.mx_cloner.php
Created November 20, 2013 04:46
Updated mx_cloner for expressionengine to work with zenbu
function set_sections()
{
$EE =& get_instance();
$out = '<script type="text/javascript" charset="utf-8">$("#accessoryTabs a.mx_cloner").parent().remove();';
//changed this line to activate cloner with zenbu
if ($EE->input->get('module') == 'zenbu' && $EE->input->get('M') == 'show_module_cp' && $EE->input->get('C') == 'addons_modules') {
$out .='
@jaseclamp
jaseclamp / pinnacle2magento-phase3.php
Created April 15, 2013 06:02
Migrate data from pinnacle cart to magento. Put script in magento root and update db connection details. This script migrates product relationships / recommendations. It's the third out of three scripts because you need the products to be there before relating them.
<?php
require_once 'app/Mage.php';
Mage::app(0); // best to leave as default as prods are created in admin and you can apply to stores as needed
//connect to your pinnacle cart database
mysql_connect("host", "user", "pass") or die(mysql_error());
//your pinnacle cart database name
mysql_select_db("db") or die(mysql_error());
@jaseclamp
jaseclamp / pinnacle2magento-phase1.php
Created April 15, 2013 05:59
This script migrates data from pinnacle cart to magento. Put this file in Magento root and edit db connection details. This script migrates categories. It's script one of three.
<?php
//this script migrates categories from pinnacle cart to magento
//it's part one of three
require_once 'app/Mage.php';
Mage::app('default'); // Default or your store view name.
mysql_connect("host", "user", "pass") or die(mysql_error());
mysql_select_db("db") or die(mysql_error());