This file contains hidden or 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
| export async function runEveryMinute({ config, cache }) { | |
| const res = await fetch('https://api.producthunt.com/v2/api/graphql', { | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| 'Authorization': `Bearer ${config.token}` | |
| }, | |
| body: JSON.stringify({ | |
| "operationName": "GetAllTheData", | |
| "variables": {}, | |
| "query": "query todayPosts { posts { edges { node { id name tagline votesCount } } } }" } |
This file contains hidden or 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
| source "https://rubygems.org" | |
| gem "octokit" |
This file contains hidden or 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
| require 'logger' | |
| require 'pusher-client' | |
| logger = Logger.new(STDOUT) | |
| options = {:secret => '~~~~~~~~~'} | |
| socket = PusherClient::Socket.new('~~~~~~~~~~~', options) | |
| # Subscribe to two channels | |
| socket.subscribe('updates') | |
| def getupdate |
This file contains hidden or 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
| $.getJSON('https://github.com/users/' + location.pathname.replace(/\//g, '') + '/contributions_calendar_data', weekendWork); | |
| function weekendWork(contribs) { | |
| var inwe = false, streak = 0, highest = 0, total = 0, possible = 0; | |
| contribs.forEach(function (c) { | |
| var d = new Date(c[0]).getDay(); | |
| if (d === 6) { | |
| inwe = true; | |
| } else if (d === 0 && inwe) { | |
| possible++; | |
| if (c[1] !== 0) { |
This file contains hidden or 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
| // HOWTO: load LABjs itself dynamically! | |
| // inline this code in your page to load LABjs itself dynamically, if you're so inclined. | |
| (function (global, oDOC, handler) { | |
| var head = oDOC.head || oDOC.getElementsByTagName("head"); | |
| function LABjsLoaded() { | |
| // do cool stuff with $LAB here | |
| } |