Skip to content

Instantly share code, notes, and snippets.

View jindrichbartek's full-sized avatar

Jindrich Bartek jindrichbartek

  • Jindrich Bartek
  • Prague
View GitHub Profile
@faceyspacey
faceyspacey / meteor-accounts-twitter-auth.js
Last active June 10, 2019 17:30
meteor-accounts-twitter-auth
const Twit = Meteor.npmRequire('twit');
Accounts.registerLoginHandler('twitter', function(params) {
const data = params.twitter;
// If this isn't twitter login then we don't care about it. No need to proceed.
if (!data) {
return undefined;
}
@sikanhe
sikanhe / improved_cache.js
Last active November 20, 2017 21:45
Most efficient way to store domain state in Redux (Indexed Key-Value Store)
//After working on the backend for a while, I started to continue working on my front end,
//I revisited my redux “cache” store and I made this improvement that made my life a lot easier.
//In my project for example, some collections i need to get the document by id, some by slug, some by username, and etc.
//If I need to account for those cases I had to make new action creators/types, for different entities.
//This is very frustrating as it makes the code less dry and leads to more boilerplate.
//Then what I realized was, I can just pass a “index” option for my insert action creators!(which defaults to “id")
//Actions
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@thoop
thoop / nginx.conf
Last active December 8, 2023 21:55
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@ondrej-kvasnovsky
ondrej-kvasnovsky / googleAnalytics-new.js
Last active April 2, 2017 19:19
Meteor with Google Analytics
Template.googleAnalytics.rendered = function() {
new GA('UA-111-1', 'my-account-name');
}
GA = function(code, account) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');