Skip to content

Instantly share code, notes, and snippets.

View berstend's full-sized avatar
🐋
⊂(◉‿◉)つ b̡͉̙̞͙͔͔̺̉͌̽̽͂̿͂͝erstend͔͝

berstend̡̲̫̹̠̖͚͓̔̄̓̐̄͛̀͘ berstend

🐋
⊂(◉‿◉)つ b̡͉̙̞͙͔͔̺̉͌̽̽͂̿͂͝erstend͔͝
  • Berlin, Germany
View GitHub Profile
@uhhuhyeah
uhhuhyeah / optimizelyRunningExperiments.js
Created September 27, 2013 19:58
Log what Optimizely experiments and variations you have been bucketed into
for (var i=0; i < window.optimizely.data.state.activeExperiments.length; i++) {
var experimentID = window.optimizely.data.state.activeExperiments[i];
var experimentName = window.optimizely.data.experiments[experimentID].name;
var variationName = window.optimizely.data.state.variationNamesMap[experimentID];
console.log(experimentName + " - " + variationName);
}
#!/bin/bash
# We need to do a few things here.
# 1) Build the repo
set -e;
APP="$2"; IMAGE="app/$APP"; NAME=$1
META="$HOME/meta"
APPMETA="$META/$NAME"
@SchumacherFM
SchumacherFM / Magento-HHVM.md
Last active May 17, 2018 18:26
Running Magento Enterprise Edition with Facebook HipHop HHVM

Running Magento Enterprise Edition with Facebook HipHop HHVM

Prerequisites

Hardware

MacBook Air (MBA) Mid 2012

@wadewilliams
wadewilliams / gist:6084150
Created July 25, 2013 21:56
Sublime Terminal Command for OSX
sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/sublime
@jreijn
jreijn / hippo-kibana-dashboard.json
Last active December 18, 2015 19:09
Hippo Kibana dashboard
{
"title": "Hippo Campus Experience Optimizer with Relevance for Targeting",
"services": {
"query": {
"idQueue": [
1,
2,
3,
4
],
@rosshadden
rosshadden / ES6-class-methods.js
Last active May 28, 2018 03:58
Dilemma in trying to obtain method list of child class from the parent constructor.
// Let's call this fileA.js.
class Controller {
constructor() {
// This is the only way I can figure out how to do what I need, but it feels shitty.
var routes = [];
for (var route in this) {
if (typeof this[route] === "function") {
routes.push(route);
}
}
@shanselman
shanselman / gist:5422230
Last active April 10, 2025 15:49
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@addyosmani
addyosmani / headless.md
Last active May 17, 2024 03:38
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@wofeiwo
wofeiwo / readLines-writeLines.go
Created April 2, 2013 04:41
read lines write lines like python api in golang
package main
import (
"io"
"os"
"bufio"
"bytes"
"fmt"
"strings"
)
@nijikokun
nijikokun / base64-utf8.module.js
Last active December 12, 2024 13:00
Javascript Base64 UTF8 for the Browser / Server. Base64 UTF-8 Encoding and Decoding Libraries / Modules for AMD, CommonJS, Nodejs and Browsers. Cross-browser compatible.
// UTF8 Module
//
// Cleaner and modularized utf-8 encoding and decoding library for javascript.
//
// copyright: MIT
// author: Nijiko Yonskai, @nijikokun, [email protected]
(function (name, definition, context, dependencies) {
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); }
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); }
else { context[name] = definition.apply(context); }