Skip to content

Instantly share code, notes, and snippets.

View ajmcagadas's full-sized avatar

Tux ajmcagadas

  • 10:35 (UTC +08:00)
View GitHub Profile
@ajmcagadas
ajmcagadas / facebook_ads_preferences.js
Created August 31, 2016 15:03
Automate removal of facebook ads preferences. Let document load > click load more until all interests are loaded > open developer tools > paste code
var rmBtns = document.querySelectorAll('[aria-label="Remove"]')
rmBtns.forEach(function(el) {
el.click();
});
@ajmcagadas
ajmcagadas / phpci.yml
Created September 9, 2016 09:54 — forked from skecskes/phpci.yml
phpci.yml Laravel 5 config
build_settings:
verbose: false
prefer_symlink: false
setup:
composer:
action: "install"
prefer_dist: false
test:
...
<tr>
<td bgcolor="#E9E9E9" class="emailcolsplit">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td style="padding-left:20px; padding-bottom:20px;">
<h2>He revels in disorganization.</h2>
<p>But you don’t have time for confusion. The IBM Journey Designer can help you refine the buyer journey across channels to create exceptional customer experiences.</p>
<img src="images/learn_01.jpg" width="115" height="34" alt=""/>
</td>
@ajmcagadas
ajmcagadas / PinEncryption.php
Created January 5, 2017 03:41
Encrypting a password with a self-signed certificate
<?php
/**
*
* @param $password A user defined password
* @return string
*
*/
public function encryptPasswordToRsaBase64(string $password): string
{
$publicKey = fopen('/path/to/public/key.pem', 'r');
@ajmcagadas
ajmcagadas / bootstrap.js
Created January 15, 2017 13:37
From vue-resource to axios configuration
window.axios = require('../../../node_modules/axios/dist/axios');
Vue.prototype.$http = axios;
axios.interceptors.request.use(function(config){
config.headers['X-CSRF-TOKEN'] = Laravel.csrfToken
return config;
})
@ajmcagadas
ajmcagadas / track.js
Last active March 8, 2017 03:45
Trigger track event when scrolling reaches the section
var o1 = o1 || {};
o1.panel0 = document.getElementsByClassName('sd-component-imagetextbanner-singtel')[0],
o1.panel1 = document.getElementsByClassName('sd-component-imagetextbanner-singtel')[1],
o1.panel2 = document.getElementsByClassName('sd-component-imagetextbanner-singtel')[2],
o1.panel3 = document.getElementsByClassName('sd-component-imagetextbanner-singtel')[3],
o1.panel4 = document.getElementsByClassName('sd-component-imagetextbanner-singtel')[4]
o1.panel5 = document.getElementsByClassName('sd-component-pagesection-singtel')[0],
o1.panel6 = document.getElementsByClassName('sd-component-pagesection-singtel')[1],
o1.panel0Trigger = false,
o1.panel1Trigger = false,
@ajmcagadas
ajmcagadas / index.html
Created April 19, 2017 09:57
A vuejs filtering of collection sample
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<div id="app">
<div class="row">
<input type="text" name="" v-model="keyword">
self.on('*.submitOnepass', function () {
var countryCode = (self.get('displayCountryCode')) ? self.get('selectedCountryCode') + '-' : '';
this.set('ssoLoginUserid', countryCode + self.get('loginid'));
this.set('countryCode', countryCode);
this.set('username', countryCode + self.get('loginid'));
this.set('tempCcode', ((self.get('displayCountryCode')) ? '+' : '') + countryCode);
this.set('loginUserid', self.get('loginid'));
this.set('loading', true);
@ajmcagadas
ajmcagadas / countdown.js
Created June 29, 2017 07:45
A sample of using javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Count Down</title>
</head>
<body>
<h1 id="countDownContainer"></h1>
@ajmcagadas
ajmcagadas / vue.html
Created August 10, 2017 03:28
A Vue.js sample to add, update, delete items in an array.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="app">
<input type="text" v-model="item.value">
<button type="button" @click="addItem" :disabled="!item.value">Add</button>