Skip to content

Instantly share code, notes, and snippets.

// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@basimf
basimf / business-models.md
Created December 27, 2019 20:19 — forked from ndarville/business-models.md
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@basimf
basimf / gist:133da54d72442ca69d9e995e082285da
Created June 3, 2018 17:54
Templating Engines for JavaScript
https://github.com/jdiamond/Nustache
https://github.com/wycats/handlebars.js/
https://github.com/linkedin/dustjs
https://github.com/mde/ejs
https://github.com/olado/doT
https://github.com/pugjs/pug
https://github.com/AlloyTeam/sodajs
@basimf
basimf / gist:bebb7bcaa5875d8077ee3d1ea6fc6993
Created May 17, 2018 18:30 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@basimf
basimf / gist:fb90fcde325bb80f66e6435617c1250c
Created April 29, 2018 14:30
Chrome DevTools: Capture full sized screenshots without a browser extension
You can type in screenshot into the Command Menu (shortcut: Cmd + Shift + P) and select one of two options:
Capture full size screenshot
Capture screenshot
The "Capture screenshot" option will download an image of your website based on what is in the visible viewport.
You can also trigger device mode, and for example emulate an iPhone. The screenshot you capture matches the exact device dimensions of the iPhone.
@basimf
basimf / introrx.md
Created August 20, 2017 16:17 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@basimf
basimf / gist:a41af64f8b6bb2d845e9686674a0c73c
Created August 8, 2017 14:05 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.