Skip to content

Instantly share code, notes, and snippets.

👾

Daniel Grijuela dgrijuela

👾
  • Madrid, Spain
Block or report user

Report or block dgrijuela

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active Jul 18, 2019
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
View article_running-web-server-in-clojure.md

Running web server in Clojure

Install Boot build tool: brew install boot-clj.

For JS people: Boot has a notion of tasks, so it's kind of similar to Grunt/Gulp.

build.boot is yours package.json and gulpfile.

ring-jetty-adapter provides Java's Jetty web framework, compojure is a routing library and hiccup is a lib for writing HTML. The task is defined using deftask macro, it runs run function which we :refer to.

@jamielob
jamielob / Meteor IOS facebook login guide.markdown
Last active Apr 8, 2017
Meteor cordova ios facebook login
View Meteor IOS facebook login guide.markdown

How to get facebook login working with Meteor and Cordova on iOS

Step 1: Make your local dev site internet accessible

Because there is an issue with OAuth2 login and localhost development, you currently have to deploy your meteor site to be able to test the Facebook login. A nice little workaround for this is to make the local instance of meteor accessible externally.

There is a great online guide for setting up port forwarding with your router and you can check your public external IP here.

For example, If you have an Apple router, simply open up Airport Utility on your Mac and click edit on your router, then go to the Network tab. Under Port Settings click the + icon and select Personal Web Sharing, setting all of the public and private ports to 3000. Make sure the private IP is set to your current computer IP.

View pragmatic-touch-icons.md

NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.

I'd like to hear how you approach this: @valuedstandards or comment on this gist.

The issue

You have to include a boatload of link elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':

![Touch Icon Links](https://o.twimg.com/2/proxy.jpg?t=HBj6AWh0dHBzOi8vcGhvdG9zLTYuZHJvcGJveC5jb20vdC8yL0FBRGFGY1VRN1dfSExnT3cwR1VhUmtaUWRFcWhxSDVGRjNMdXFfbHRJWG1GNFEvMTIvMjI3OTE2L3BuZy8xMDI0eDc2OC8yL18vMC80L1NjcmVlbnNob3QlMjAyMDE1LTA0LTE0JTIwMTYuNTYuMjYucG5nL0NNejBEU0FCSUFJZ0F5Z0JLQUkvNGR1eDZnMzZmYnlzYWI3

@MFQ
MFQ / gist:a308a8f05bb87b78c756
Created Apr 2, 2015
Mobile-config.js for meteor
View gist:a308a8f05bb87b78c756
App.info({
name: 'Todos',
description: 'A simple todo list app built in Meteor.',
author: 'Percolate Studio Team',
email: 'us@percolatestudio.com',
website: 'http://percolatestudio.com',
version: '0.0.1'
});
App.icons({
@fuzzyalej
fuzzyalej / functional_javascript.js
Last active Aug 29, 2015
Functional JS Workshop
View functional_javascript.js
function cell(value) {
return {
value: value,
next: null //null is cool
};
}
function cons(value, list) {
var tmp = cell(value);
tmp.next = list || null;
View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
View essential-javascript-links.md
@krasnoukhov
krasnoukhov / 2013-01-07-profiling-memory-leaky-sidekiq-applications-with-ruby-2.1.md
Last active Jun 11, 2019
Profiling memory leaky Sidekiq applications with Ruby 2.1
View 2013-01-07-profiling-memory-leaky-sidekiq-applications-with-ruby-2.1.md

My largest Sidekiq application had a memory leak and I was able to find and fix it in just few hours spent on analyzing Ruby's heap. In this post I'll show my profiling setup.

As you might know Ruby 2.1 introduced a few great changes to ObjectSpace, so now it's much easier to find a line of code that is allocating too many objects. Here is great post explaining how it's working.

I was too lazy to set up some seeding and run it locally, so I checked that test suite passes when profiling is enabled and pushed debugging to production. Production environment also suited me better since my jobs data can't be fully random generated.

So, in order to profile your worker, add this to your Sidekiq configuration:

if ENV["PROFILE"]
You can’t perform that action at this time.