Skip to content

Instantly share code, notes, and snippets.

View ricalamino's full-sized avatar
♦️
Piece of peace

Ricardo Alamino ricalamino

♦️
Piece of peace
View GitHub Profile
@ricalamino
ricalamino / loginNoLock.js
Created October 4, 2018 20:34
Login Without Lock for auth0
public loginNoLock(username: string, password: string): void {
const postData = {
username,
password,
client_id: environment.Auth0.clientID,
connection: 'Username-Password-Authentication',
scope: environment.Auth0.scope
};
const req = this.http.post('https://' + environment.Auth0.domain + '/oauth/ro', postData, {
@ricalamino
ricalamino / keep_utm_queries.php
Created September 17, 2018 17:24
Keep UTM in Wordpress - Put in functions.php
<?php
function add_my_query_var( $link, $query ) {
$utm_source = $_GET['utm_source']; //get sort value
if ( isset($utm_source) ) { //if browsing posts by votes
$link = add_query_arg( 'utm_source', $utm_source, $link );
}
$utm_medium = $_GET['utm_medium']; //get sort value
if ( isset($utm_medium) ) { //if browsing posts by votes
$link = add_query_arg( 'utm_medium', $utm_medium, $link );
@ricalamino
ricalamino / sample.js
Last active August 6, 2018 14:48 — forked from manix/sample.js
Improved "fieldSorter" - usage( arrayOfObjects.sort(fieldSorter(['-price', 'orderId'])); )
function fieldSorterOptimized(fields) {
var dir = [], i, l = fields.length;
fields = fields.map(function(o, i) {
if (o[0] === "-") {
dir[i] = -1;
o = o.substring(1);
} else {
dir[i] = 1;
}
return o;
@ricalamino
ricalamino / extensions.json
Last active August 13, 2020 16:13
VSCode's Settings - Syncing
[
{
"id": "CoenraadS.bracket-pair-colorizer-2",
"name": "bracket-pair-colorizer-2",
"publisher": "CoenraadS",
"version": "0.2.0"
},
{
"id": "dbaeumer.vscode-eslint",
"name": "vscode-eslint",