Skip to content

Instantly share code, notes, and snippets.

View vincentleeuwen's full-sized avatar

Vincent van Leeuwen vincentleeuwen

  • Berlin
View GitHub Profile
@vincentleeuwen
vincentleeuwen / scroll-tracker.js
Created February 12, 2020 03:45
JS scroll tracker we use in Shopify to have people return where they scrolled to when they hit a breadcrumb (es5).
const trackScrollHistory = () => {
const { location: { pathname } } = window;
const cleanPath = pathname.split('?')[0];
const handlePageScroll = () => sessionStorage.setItem(cleanPath, window.pageYOffset);
const scrollToOffset = offset => window.scrollTo(0, offset);
const handlePageLoad = () => {
const offset = sessionStorage.getItem(cleanPath);
offset ? scrollToOffset(parseInt(offset, 10)) :
sessionStorage.setItem(cleanPath, window.pageYOffset);
}
@vincentleeuwen
vincentleeuwen / README.md
Created January 29, 2020 14:45 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
const app = {
run: () => {
// Vanaf hier declare je in de local scope, niet de global scope.
const print = text => console.log(text);
print('Hello');
print('World');
}
};
[
{
"id": 7428,
"profile": {
"player": {
"id": 364,
"name": "Aaron Hughes",
"slug": "1650-aaron-hughes"
},
"club": {
@vincentleeuwen
vincentleeuwen / rushkick.json
Last active December 28, 2015 18:39
RushKick Data API JSON sample output
{
"data": [{
"player": "Luis Suarez",
"player_id": "4433-luis-su-z",
"team": "Liverpool",
"team_id": "13-liverpool",
"played": "TRUE",
"mins_played": 87,
"goals": 2,
"assists": 0,
@vincentleeuwen
vincentleeuwen / gist:6364739
Last active December 21, 2015 20:58
SNTMNT Trading Indicator
{
"data":[{
"stock_id":160,
"ticker":"AMZN",
"name":"Amazon.com, Inc.",
"fin_sntmnt_score":4.365099602399999,
"fin_sntmnt_score_1":0.0,
"fin_sntmnt_score_3":0.0,
"fin_sntmnt_score_6":1.4429479734,
"fin_sntmnt_avg_score":-9.7487073016333,
@vincentleeuwen
vincentleeuwen / gist:6093088
Created July 27, 2013 00:20
SNTMNT json example
{
"data": [{
"stock_id": 163,
"ticker": "AAPL",
"name": "Apple Inc.",
"fin_sntmnt_score": 0.58378776,
"fin_sntmnt_avg_score": 68.7788001631164,
"fin_sntmnt_momentum": -0.38382559433322,
"comm_sntmnt_score": 11239.1272482,
"comm_sntmnt_avg_score": 21010.6054282,

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

<!doctype html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/kevinburke/tecate/master/tecate.js"></script>
<!-- ... more files in the head ... -->
</head>
<body>
<!-- ... the body content ... -->