Skip to content

Instantly share code, notes, and snippets.

<div id="cielo_container">
<script>
$(document).ready(function(){
$('.cielo_options input').change(function(){
$('.cielo_show_options .form_wrap').hide();
var option = $('.cielo_options input:checked').data('show');
var debit = $('.cielo_options input:checked').data('debit');
$('#'+option).show();
if (debit == 'no') {
@onefriendaday
onefriendaday / view_cart.html
Last active December 28, 2023 23:01
Pagseguro checkout transparent
<script type="text/javascript" src="https://stc.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.directpayment.js"></script>
<script type="text/javascript">
var paymentModule = 'pagseguro_app';
checkoutCallbacks.add(pagseguroCheckout);
function pagseguroCheckout() {
if ($('input[name=module]').val() == paymentModule) {
<div id="moip_container">
<style type="text/css">
.moip_exp_date_mm{
width: 40%;
}
.moip_exp_date_yy{
width: 50%;
}
.moip_cc_seperator{
@onefriendaday
onefriendaday / gist:56c7a8835697bd1376d2
Last active August 29, 2015 14:06
Callbacks in Xtech checkout
// Vars that needs to be set in order to work with pagseguro checkout process
var checkoutCallbacks = $.Callbacks();
var checkoutNoSubmit = false;
$('#onepage_checkoutform').submit(function(e){
// This calls the callback from ex. pagseguro.
checkoutCallbacks.fire('checkout');
// If the checkoutNoSubmit variable is set to false go and submit the form, otherwise prevent the form submit.
<?php
class ApiTest {
private $config;
function __construct($config)
{
$this->config = $config;
}
@onefriendaday
onefriendaday / settings.json
Created January 23, 2015 19:03
Example to overwrite and add new language strings in xtechcommerce
{
"template_settings": {
"group:general": {"label": "General"},
"image:logo": {"label": "Logo", "default": ""},
"text:instagram_hashtag": {"label": "Instagram Hashtag", "default": "hashtag"}
},
"lang": {
"post_on_instagram": {"en": "Post on instagram with", "de": "Poste auf instagram mit", "pt": "Poste sua foto com a hashtag"},
"hi_user": {"en": "Hi {user}", "de": "Hallo {user}", "pt": "Oi {user}"},
"hi_visitor": {"en": "Hi visitor", "de": "Hallo Besucher", "pt": "Oi visitante"},
if (isset($_FILES['file'])) {
move_uploaded_file($_FILES['file']['tmp_name'], 'tmp/'.$_FILES['file']['name']);
}
@onefriendaday
onefriendaday / gist:6b347b186171ec140688
Created May 4, 2015 05:40
Browserify Grunt example
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('default',['watch']);
// Project configuration.
grunt.initConfig({
@onefriendaday
onefriendaday / .htaccess
Last active August 31, 2015 10:36
Block IP
RewriteCond %{REMOTE_HOST} !^62\.99\.210\.9
RewriteCond $1 !^(wartung_index\.php|images/)
RewriteRule ^(.*)$ /wartung_index.php/$1 [L]
RewriteCond %{HTTP_X_FORWARDED_FOR} !^62\.99\.210\.9
RewriteCond $1 !^(wartung_index\.php|images/)
RewriteRule ^(.*)$ /wartung_index.php/$1 [L]
(function ($) {
$(document).ready(function () {
if (['#download-container', '#video-container'].indexOf(window.location.hash) > -1 || window.location.hash.indexOf('video-play') > -1) {
if (window.location.hash.indexOf('video-play') > -1) {
var container = $('#video-container');
} else {
var container = $(window.location.hash);
}