Skip to content

Instantly share code, notes, and snippets.

@jaredkipe
jaredkipe / gist:ffc78108f43b09fad4c507591fb4e30c
Last active December 22, 2018 18:05
ShipBox provision -- WIP
#!/bin/bash
# or run the script as root.
sudo -s
mount -o remount,rw / && mount -o remount,rw /root_bypass_ramdisks/ \
&& mount --bind /root_bypass_ramdisks/etc /etc \
&& mount --bind /root_bypass_ramdisks/var /var
# Installs.
apt-get update && apt-get install -y cups nginx
if contract.paid_hourly:
result = contract.wage * worked_days.ATTN.number_of_hours
else:
result = contract.wage
@jaredkipe
jaredkipe / o_animate.frontend.js
Created August 30, 2017 15:13
Fix animation in Safari, fix initial visibility flicker in Chrome
odoo.define('website_animate.o_animate_frontend', function (require) {
'use strict';
var s_animation = require('web_editor.snippets.animation');
var base = require('web_editor.base');
var WebsiteAnimate = {
win : {},
items : {},
-- note that you should find and replace the 'new color' (#505fb5) prior to running.
-- Colors
UPDATE mail_template set body_html =
replace(replace(body_html, '#875A7B', '#505fb5'), 'rgb(135,90,123)', '#505fb5')
;
-- Footers
@jaredkipe
jaredkipe / gist:aac643f287445ac76e65
Last active October 1, 2015 18:04
Migrate res.partner images (odoo shell)
partners = env['res.partner'].search([])
for p in partners:
if not p.image:
env.cr.execute("SELECT image FROM res_partner WHERE id = " + str(p.id) + ";")
d = env.cr.fetchall()
p.image = str(d[0][0])
env.cr.commit()
# verify data is migrated then
@jaredkipe
jaredkipe / gist:6ee68f62bfcd102f0779
Last active August 29, 2015 14:05
2e2v28/8202014_challenge_176_hard_spreadsheet_developer
<?php
/**
* Class Cell
* Converts string into col/row representation.
*/
class Cell {
public $col = 0;
public $row = 0;
@jaredkipe
jaredkipe / gist:1ffe9934ddecc612d372
Created August 19, 2014 21:25
8182014_challenge_176_easy_spreadsheet_developer
<?php
/**
* Class Cell
* Converts string into col/row representation.
*/
class Cell {
public $col = 0;
public $row = 0;