Skip to content

Instantly share code, notes, and snippets.

View LeCoupa's full-sized avatar
:octocat:
Keep pushing ⚡️

Julien Le Coupanec LeCoupa

:octocat:
Keep pushing ⚡️
View GitHub Profile
// Let's cache a few things that are static. Setup times don't matter.
var e = $.Event('keydown');
e.which = 32;
e.keyCode = 32;
var input = $('#typer-input')[0];
var words = $('#paragraph > span').get().map(function(element){
return element.innerHTML;
});
@alanshaw
alanshaw / gist:10046987
Last active August 29, 2015 13:58
Meteor, MongoDB, oplog tailing and you

Meteor, MongoDB, oplog tailing and you


Prior art

  • Pub sub
  • Live data sets
  • Poll and diff
# Meteor & Spooky Bootstrap. (Growth Hacking)
# You may also be interested by the PhantomJS, CasperJS & Spooky CheatSheet
# https://gist.github.com/LeCoupa/10008302
# Choose XPath over CSS3 selectors it's much more powerful and less buggy
# https://gist.github.com/LeCoupa/8c305ec8c713aad07b14
# Use Meteor-NPM to install these npm packages
@zhchbin
zhchbin / index.html
Created February 10, 2013 10:55
Node-Webkit API Demo: Window.capturePage
<html>
<body style="background: #333">
<script >
var gui = require('nw.gui');
var win = gui.Window.get();
function takeSnapshot() {
win.capturePage(function(img) {
var popWindow = gui.Window.open('popup.html',
{width: 420, height: 300});
popWindow.on('loaded', function() {
@imjared
imjared / scraping-with-casperjs.js
Created March 20, 2013 00:33
A CasperJS script that crawled a list of links on then scraped the relevant content on each page and output it to a nicely formatted XML file. Sure beats database dumps/SQL manipulation, in my opinion.
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* grab links and push them into xml
*/
var casper = require("casper").create({
});
module.exports = {
outDir: 'public',
babel: {
babelrc: false
},
banner: true,
format: ['umd-min'],
css: true,
plugins: ['vue']
};
@dferber90
dferber90 / .eslintrc.yml
Last active June 21, 2019 13:27
Example setup of ESLint-plugin-Meteor with AirBnB's code style
# enable ES6
parserOptions:
ecmaVersion: 6
sourceType: "module"
ecmaFeatures:
jsx: true # enable React's JSX
# register plugins
plugins:
- meteor
@n1k0
n1k0 / 404checker.js
Created January 11, 2013 10:55
A CasperJS script to check for 404 & 500 internal links on a given website
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
<template name="SignIn">
<form action="/signin" id="signInForm" method="post">
<input id="signInEmail" type="text" name="email" placeholder="Email Address">
<input id="signInPassword" type="password" name="password" placeholder="Password">
<input class="btn-submit" type="submit" value="Sign In">
</form>
<!-- end #sign-in-form -->
</template>
@LeCoupa
LeCoupa / meteor-reactive-nonreactive-join.html
Last active February 27, 2020 05:53
Meteor: Reactive and Nonreactive Join with MongoDB --> https://github.com/LeCoupa/awesome-cheatsheets
<!--
The examples below illustrate different ways to make a reactive and nonreactive join between two collections.
We will retrieve in all of them a list of the 10 most popular posts along with their author profile.
More informations are available on: http://journal.gentlenode.com/
Summary:
1. Nonreactive Join #1: Denormalization.
2. Reactive Join #1: Joining on the client. (by calling a publication)
3. Reactive Join #2: Overpublishing. (and joining with data context)