View StaticTwitterEmbed.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const official = require("gatsby-remark-embedder/dist/transformers/Twitter") | |
const Twitter = require("twitter-lite") | |
// Memoized twitter client instance | |
let twitterClient = null | |
async function getAppClient() { | |
if (twitterClient) { | |
return twitterClient | |
} |
View History|-1096ae74|entries.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"version":1,"resource":"file:///Users/Swizec/Documents/websites/swizec.com/src/pages/blog/week-17-what-happens-when-you-only-eat-meat-for-a-year/index.mdx","entries":[{"id":"Q6eg.mdx","timestamp":1652114366832}]} |
View template-language-compiler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/////////////////////////////////////////////////////////////////// | |
// // | |
// file: template.php // | |
// scripter: swizec // | |
// contact: swizec@swizec.com // | |
// started on: 18th May 2005 // | |
// version: 0.12.0 // | |
// // |
View HNApi.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cheerio from 'cheerio-without-node-native'; | |
const convertRequestBodyToFormUrlEncoded = (data) => { | |
const bodyKeys = Object.keys(data); | |
const str = []; | |
for (let i = 0; i < bodyKeys.length; i += 1) { | |
const thisKey = bodyKeys[i]; | |
const thisValue = data[thisKey]; | |
str.push(`${encodeURIComponent(thisKey)}=${encodeURIComponent(thisValue)}`); |
View machine.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
View machine.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
View paragraph_counter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.waypoints.settings.scrollThrottle = 30; | |
try { | |
mpmetrics = new MixpanelLib("<api_key>"); | |
} catch(err) { | |
var null_fn = function () {}; | |
mpmetrics = { | |
track: null_fn, | |
track_funnel: null_fn, |
View gist:100cf58948c84e7454ad9c9dbe9e1d37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15:53:14.409 [INFO ] Copying the repository's data: RepositoryEntry{id=9dd45702-6fa8-11e8-99db-fa163e67f194, projectId=76bade28-2ce8-11e8-bb6e-fa163ee88118, name='non-root-uf', url='https://gecgithub01.walmart.com/ms-tf-logsearch/mls-splunk-uf.git', branch='master', commitId='null', path='null', secretId=28c1842a-67c0-11e8-94f9-fa163e67f194, secretName='mls-uf-pass_1', hasWebHook=true, secretStoreType=null} | |
15:53:15.719 [INFO ] Storing policy 'concord-system' data | |
15:53:15.768 [INFO ] Using entry point: default | |
15:53:16.449 [INFO ] Applying policies... | |
15:53:19.026 [INFO ] Acquired by: Concord-Agent: id=2fe38959-6d20-56a7-8e49-2bfbbc206741 (10.227.246.95) | |
15:53:20.609 [INFO ] Process status: RUNNING | |
Agent ID: 2fe38959-6d20-56a7-8e49-2bfbbc206741 | |
15:53:20.399 [INFO ] Checking the dependency policy | |
Dependencies: | |
mvn://com.walmartlabs.concord.plugins.basic:concord-tasks:0.78.1 |
View .eslintrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ecmaFeatures: | |
modules: true | |
jsx: true | |
parser: | |
babel-eslint | |
env: | |
amd: true | |
browser: true |
View quick redux from scratch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createStore(reducer, preloadedState) { | |
let state = preloadedState; | |
let listeners = []; | |
const subscribe = (callback) => { | |
listeners = [...listeners, callback]; | |
return function () { | |
listeners = listeners.filter(f => f !== callback); | |
} | |
} |
NewerOlder