Skip to content

Instantly share code, notes, and snippets.

View JulianJorgensen's full-sized avatar
🎯
Focusing

Julian Jorgensen JulianJorgensen

🎯
Focusing
View GitHub Profile
@JulianJorgensen
JulianJorgensen / gist:f2b573602ed3110db8e8bdb5f47984f4
Created November 5, 2019 15:27
Inspration checkout API integration
const sendEvent = (productId) => {
const clientId = getClientId(); // GA client id
if (!clientId) {
return;
}
const body = {
action: "purchase",
product_id: `${productId}`,
ids: [`ga:${clientId}`]
};
componentDidMount() {
// add this Parallax element to the global listener
if (typeof ParallaxController === 'undefined') {
throw new Error(
'Must initialize the ParallaxController before adding React Parallax components.'
);
}
// create a new parallax element and save the reference
this.element = ParallaxController.createElement({
elInner: this._inner,
@JulianJorgensen
JulianJorgensen / ParallaxController.js
Created September 15, 2017 00:22
ParallaxController.js
function _setParallaxStyles(element) {
const top = element.attributes.top - scrollY;
const { totalDist } = element.attributes;
// Percent the element has moved based on current and total distance to move
const percentMoved = (top * -1 + windowHeight) / totalDist * 100;
// Scale percentMoved to min/max percent determined by offset props
const { slowerScrollRate, fadeSpeed } = element.props;
@JulianJorgensen
JulianJorgensen / custom.css
Created July 14, 2017 00:30
sunniva homepage css
/* hide the unneccessary header space on mobile */
.page.home #header-space{
display: none !important;
}
.page.home .fp-tableCell{
height: 100vh !important;
}
/* Make mobile full screen height on all devices */
@JulianJorgensen
JulianJorgensen / untitled
Created April 5, 2017 15:57
max deploy error
An error occurred while installing nokogiri (1.7.0.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.7.0.1'` succeeds before bundling.
Installing npm dependencies... (this could take a while)
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated [email protected]: Use uuid module instead
Unexpected platform or architecture: freebsd/x64
It seems there is no binary available for your platform/architecture
Try to install PhantomJS globally
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
@JulianJorgensen
JulianJorgensen / untitled
Created March 9, 2017 18:49
adobe-max-mpc-fetch-error
jekyll 3.0.3 | Error: Net::ReadTimeout
[12:49:12] 'jekyll-build' errored after 1.05 min
[12:49:12] Error: 1
at formatError (/Users/julianjorgensen/sites/adobe-max/node_modules/gulp/bin/gulp.js:169:10)
at Gulp.<anonymous> (/Users/julianjorgensen/sites/adobe-max/node_modules/gulp/bin/gulp.js:195:15)
at emitOne (events.js:101:20)
at Gulp.emit (events.js:188:7)
at Gulp.Orchestrator._emitTaskDone (/Users/julianjorgensen/sites/adobe-max/node_modules/orchestrator/index.js:264:8)
at /Users/julianjorgensen/sites/adobe-max/node_modules/orchestrator/index.js:275:23
at finish (/Users/julianjorgensen/sites/adobe-max/node_modules/orchestrator/lib/runTask.js:21:8)
@JulianJorgensen
JulianJorgensen / .bash_profile
Created September 7, 2016 23:14
Remove merged branches
rmb()
{
current_branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
if [ "$current_branch" != "master" ]; then
echo "WARNING: You are on branch $current_branch, NOT master."
fi
echo "Fetching merged branches..."
git remote prune origin
remote_branches=$(git branch -r --merged | grep -v '/master$' | grep -v "/$current_branch$")
local_branches=$(git branch --merged | grep -v 'master$' | grep -v "$current_branch$")
@JulianJorgensen
JulianJorgensen / .bash_profile
Last active September 7, 2016 20:32
bash profile aliases
# git branch highlighting
function parse_git_branch
{
branch=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'`
if [ -n "$branch" ]; then
echo "${branch} "
fi
}
function proml
{
@JulianJorgensen
JulianJorgensen / untitled
Created March 24, 2016 20:57
permission error
(2015-archive) ~/sites/adobe-max-2015$ ssh-add ~/.ssh/id_rsa
Identity added: /Users/julianjorgensen/.ssh/id_rsa (/Users/julianjorgensen/.ssh/id_rsa)
(2015-archive) ~/sites/adobe-max-2015$ ssh -v deploybot
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /Users/julianjorgensen/.ssh/config
debug1: /Users/julianjorgensen/.ssh/config line 1: Applying options for deploybot
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to deploybot.coverallcrew.com [54.200.168.247] port 2242.
debug1: Connection established.
@JulianJorgensen
JulianJorgensen / gist:a42edd31b3258c846240
Created February 28, 2016 19:16
Boxen installation error
--> Configuring. Prepare for a long wait and some weird output.
I might have to ask you for your password again too.
--> Preparing to auto-update...
--> Skipping auto-update, since this isn't a git checkout yet
====> Installing gem dependencies
Error: Syntax error at '::JulianJorgensen' at /opt/boxen/repo/modules/people/manifests/julianjorgensen.pp:1 on node julians-macbook-air.local
Error: Syntax error at '::JulianJorgensen' at /opt/boxen/repo/modules/people/manifests/julianjorgensen.pp:1 on node julians-macbook-air.local
fatal: Not a git repository (or any of the parent directories): .git