Skip to content

Instantly share code, notes, and snippets.

André Dumas andredumas

Block or report user

Report or block andredumas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View datetime.rb
package "language-pack-en" do
action :install
end
package "tzdata" do
action :install
end
link "/etc/localtime" do
to "/usr/share/zoneinfo/Australia/Melbourne"
View swap.rb
execute "mkswap" do
command "dd if=/dev/zero of=/var/swapfile bs=1024 count=$((1226*1024)); mkswap /var/swapfile"
creates "/var/swapfile"
umask 0077
action :run
end
mount "none" do
action :enable
device "/var/swapfile"
@andredumas
andredumas / datetime.pp
Last active Aug 29, 2015
Online note of a manifest I regularly use to set date, time and timezone information on ubuntu hosts. Works on vagrant box precise64 (http://files.vagrantup.com/precise64.box) and AWS EC2 Ubuntu instances.
View datetime.pp
# Make sure you apt-get update before applying this.
package { "language-pack-en":
ensure => latest
}
package { "tzdata":
ensure => latest
}
@andredumas
andredumas / swap.pp
Last active Aug 29, 2015
Online note of a manifest I regularly use to create swap on AWS EC2 Ubuntu instances.
View swap.pp
exec { "mkswap":
command => "dd if=/dev/zero of=/swap bs=1024 count=$((1226*1024)); mkswap /var/swapfile",
creates => "/var/swapfile"
}
file { "/var/swapfile":
ensure => present,
mode => 600,
require => Exec["mkswap"]
}
View weekday.js
weekday = (function() {
// Returns the weekday number for the given date relative to January 1, 1970.
function weekday(date) {
var weekdays = weekdayOfYear(date),
year = date.getFullYear();
while (--year >= 1970) weekdays += weekdaysInYear(year);
return weekdays;
}
@andredumas
andredumas / default.rb
Created Jun 27, 2014
Headless Google Cloud Print Upstart script and a partial supporting recipe
View default.rb
# NOTE: This is partially complete and not ready for use, watch out for <user> tokens!
# Requires:
# * Printer drivers installed and registered with CUPS
# * Chrome installation (36 Beta was required at the time due to https://code.google.com/p/chromium/issues/detail?id=375841#c6)
# * A Generated "Service State" file (Instructions https://support.google.com/a/answer/2906017?hl=en)
package "cups"
service "cups" do
action [:enable, :start]
@andredumas
andredumas / remote-post.html
Created Oct 30, 2014
Posting JSON Cross Domain
View remote-post.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="http://remote.com/index.html"
method="post"
enctype="multipart/form-data"
@andredumas
andredumas / custom.accessor.js
Last active Aug 19, 2016
TechanJS Accessors Example
View custom.accessor.js
/**
* Demonstrating configuring a techanjs plot to accept and plot custom data types.
*/
// Either, update the default plot accessor
// All plots have default accessors. Here we are updating the default and redefining how
// to get close from the data
candlestick.accessor().close(function(d) {
return d.currentBid; // Where d is an item in your supplied array
});
View README.md

JsPerf

Test cases for javascript browser profiling.

@andredumas
andredumas / README.md
Last active Sep 28, 2016 — forked from fojt/data.csv
TechanJS Average Directional Index (ADX)
View README.md

Average Directional Index (ADX) calculation and rendering demo.

You can’t perform that action at this time.