Skip to content

Instantly share code, notes, and snippets.

View intel352's full-sized avatar

Jonathan Langevin intel352

View GitHub Profile
@intel352
intel352 / webtail
Created April 9, 2014 17:24
Webtail - continously tail a long-running remote webpage/file
#!/bin/bash
POLLING_INTERVAL=2
CONTENT_LENGTH=0
while true
do
FETCH_CONTENT_LENGTH=`curl -s -r 0-0 -I $1 | egrep -i "Content-Range" | cut -d/ -f2 | awk -F"\r" '{print $1}'`
TMP_CONTENT_LENGTH=$FETCH_CONTENT_LENGTH
@intel352
intel352 / rebrew.sh
Last active August 29, 2015 14:03
Brew (homebrew) reinstall packages - useful after upgrading OS versions or migrating
#!/bin/bash
brew list > ~/brewlist
brew remove --force $(brew list)
brew install $(cat ~/brewlist)
@intel352
intel352 / gist:32b8e12c6af704f08446
Created August 2, 2014 20:02
DS4 won't connect to DS4Tool
2014-08-02T19:56:55.4764311Z> Operating System: Microsoft Windows 8.1 Pro x64
2014-08-02T19:56:55.4774312Z> Locale: en-US
2014-08-02T19:56:55.8584521Z> IE version: 11.0.9600.17207
2014-08-02T19:56:55.8644525Z> Browser emulation set for 11
Language change to: en-US
(Default)
en-US
2014-08-02T19:56:56.0054598Z> Loading profile using method 5
2014-08-02T19:56:56.0144611Z> Loading profile using method 5
2014-08-02T19:56:56.0404668Z> Loading profile using method 5
@intel352
intel352 / PostalCode.ds
Created August 22, 2014 15:11
Postal code validation
importPackage( dw.system );
importScript("utils/Underscore.ds");
var _ = getUnderscore();
function PostalCode() {}
(function(){
// Sourced from http://unicode.org/cldr/trac/browser/tags/release-24/common/supplemental/postalCodeData.xml
PostalCode.patterns = [
ChangeLog of JSch
====================================================================
Last modified: Fri Jun 5 03:22:57 UTC 2015
Changes since version 0.1.52:
- bugfix: the rekey initiated by the remote may crash the session.
- change: Logjam: use ecdh-sha2-nistp* if available,
ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
diffie-hellman-group14-sha1,
@intel352
intel352 / master-variant.xml
Created May 25, 2016 15:50
Sample master/variant product DWRE
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://www.demandware.com/xml/impex/catalog/2006-10-31" catalog-id="apparel-catalog">
<product product-id="25696717">
<ean/>
<upc/>
<unit/>
<min-order-quantity>1</min-order-quantity>
<step-quantity>1</step-quantity>
<display-name xml:lang="x-default">Floral Black and White Dress.</display-name>
<display-name xml:lang="fr-FR">Robe fleurie noir et blanc</display-name>
@intel352
intel352 / Jenkinsfile.groovy
Created May 26, 2016 16:51
Demandware Jenkinsfile build
node {
stage 'Checkout'
checkout scm
env.BUILD_TAG_CLEANED = "${env.BUILD_TAG}".replaceAll(/\%\d[a-zA-Z]/, "-").replaceAll(/[^\w-]+/, "")
env.ENABLE_TWO_FACTOR = 'false'
env.ENVIRONMENT_INSTANCE = 'dev03' // test build sandbox for branches != develop
if (env.BRANCH_NAME == 'develop') {

dwupload

Upload a storefront cartridge to a Demandware WebDAV server from command line.

Installation

:; npm install -g bitbucket:demandware/dwupload

Instead of installing this as a global npm package, you can install it locally and access it as ./node_modules/.bin/dwupload.

@intel352
intel352 / run-in-console.js
Created May 22, 2017 19:30
Filter wizardofodds online casino list by 5-star, wizard seal, US friendly.
// For use on https://wizardofodds.com/online-gambling/all-casinos/
$('div#all_casinos_area table.data td').filter(
function(index){
if ( (index%5) === 1) {
var el = $(this).find('span.filled-stars');
var width = el.width();
var parentWidth = el.offsetParent().width();
var percentWidth = 100*width/parentWidth;
if (percentWidth <= 90) {
// remove low ranked
@intel352
intel352 / run-in-console.js
Created May 22, 2017 19:31
Filter wizardofodds online casino list by 5-star, wizard seal, US friendly.
// For use on https://wizardofodds.com/online-gambling/all-casinos/
// Copy the below javascript, paste into JS console on the above page, execute.
$('div#all_casinos_area table.data td').filter(
function(index){
if ( (index%5) === 1) {
var el = $(this).find('span.filled-stars');
var width = el.width();
var parentWidth = el.offsetParent().width();
var percentWidth = 100*width/parentWidth;
if (percentWidth <= 90) {