Skip to content

Instantly share code, notes, and snippets.

View mreis1's full-sized avatar

Reis mreis1

View GitHub Profile
@dypsilon
dypsilon / cro.md
Created November 4, 2014 15:02
CRO

Conversion Rate Optimization (CRO)

In internet marketing, conversion optimization, or conversion rate optimization (CRO) is the method of creating an experience for a website or landing page visitor with the goal of increasing the percentage of visitors that convert into customers. It is also commonly referred to as CRO.

@adrianorsouza
adrianorsouza / sublime-command-line.md
Last active September 26, 2023 16:26
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@ToeJamson
ToeJamson / 1.swift
Last active February 19, 2020 18:41
Smart iBeacons in the Swift Programming Language
class Brain: NSObject, PNDelegate {
let config = PNConfiguration(forOrigin: "pubsub.pubnub.com", publishKey: "demo", subscribeKey: "demo", secretKey: nil)
var channel = PNChannel()
var serverStatus = UILabel()
init() {
super.init()
}
}
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active April 19, 2024 01:50
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@BobNisco
BobNisco / controller.js
Last active February 27, 2023 15:43
onLongPress AngularJS Directive - Great for mobile!
// Somewhere in your controllers for this given example
// Example functions
$scope.itemOnLongPress = function(id) {
console.log('Long press');
}
$scope.itemOnTouchEnd = function(id) {
console.log('Touch end');
}
@nolanlawson
nolanlawson / couchperuser.md
Last active March 13, 2021 21:08
Solving "one database per user" in CouchDB/IrisCouch/Cloudant

Background

Security in a single CouchDB can only be set up to do either:

  • Everyone can read/write everything (admin party)
  • Everyone can read, some can write
  • Some can read everything, and those same people can write everything

So in the very common situation where you want user data to be private, the current best practice is to give every user a database. This sounds nuts at first, but it turns out that databases are cheap in CouchDB; Cloudant boasts that 100k databases in a single Couch is not uncommon (source).

@pasupulaphani
pasupulaphani / after_res_hooks.js
Last active May 1, 2024 20:37
Mongoose connection best practices
var db = mongoose.connect('mongodb://localhost:27017/DB');
// In middleware
app.use(function (req, res, next) {
// action after response
var afterResponse = function() {
logger.info({req: req}, "End request");
// any other clean ups
@koenpunt
koenpunt / chosen-bootstrap.css
Last active March 11, 2023 01:01
Bootstrap 3.0 theme for Chosen
select.form-control + .chosen-container.chosen-container-single .chosen-single {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@nikmartin
nikmartin / A: Secure Sessions Howto
Last active April 28, 2024 05:17
Secure sessions with Node.js, Express.js, and NginX as an SSL Proxy
Secure sessions are easy, but not very well documented.
Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy:
The desired configuration for using NginX as an SSL proxy is to offload SSL processing
and to put a hardened web server in front of your Node.js application, like:
[NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [PUBLIC INTERNET] <-> [CLIENT]
Edit for express 4.X and >: Express no longer uses Connect as its middleware framework, it implements its own now.