Skip to content

Instantly share code, notes, and snippets.

View magnum's full-sized avatar
💭
experimenting...

Antonio Molinari magnum

💭
experimenting...
View GitHub Profile
describe('fizz buzz',function(){
var self = this;
beforeEach(function(){
var threeChecker = new Checker(3, "Fizz");
var fiveChecker = new Checker(5, "Buzz");
var sevenChecker = new Checker(7, "Bang");
self.fizzBuzzer = new FizzBuzzer([threeChecker, fiveChecker, sevenChecker]);
});
it('Default is say the number',function(){

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

AsyncProcess = require('./async-process').AsyncProcess
describe('AsyncProcess', function() {
var asyncProcess;
beforeEach(function() {
asyncProcess = new AsyncProcess();
});
it('should process 42', function() {
@magnum
magnum / circle_path
Created September 11, 2018 21:18 — forked from straydogstudio/circle_path
Convert latitude/longitude pair with radius in meters to 16 sided polygon useful in GIS. Useful for converting a Google maps drawing manager circle into a polygon for storage in a GIS system. Implemented as a class method.
def self.circle_path(center, radius, complete_path = false)
# For increased accuracy, if your data is in a localized area, add the elevation in meters to r_e below:
r_e = 6378137.0
@@d2r ||= Math::PI/180
@@multipliers ||= begin
segments = 16
dRad = 2*Math::PI/segments
(segments + (complete_path ? 1 : 0)).times.map do |i|
rads = dRad*i
y = Math.sin(rads)
@magnum
magnum / gsap-properties-cheat-sheet.md
Created January 15, 2019 10:36 — forked from lunelson/gsap-properties-cheat-sheet.md
Greensock Properties Cheat Sheet

Greensock CSS properties Cheat Sheet

I wrote this as a reference for myself because some of the property names are non-obvious, and there are a number of relevant special properties, and there is no central concise listing of them all in GSAP Docs, other than (in longer form) on the CSSPlugin page.

Standard CSS properties

...are all supported, with hyphenated-names becoming camelCaseNames. Non-animatable properties are also supported but they will be set at the beginning of the tween.

Special mentions:

BEGIN:VCARD
VERSION:3.0
N:qrd°by;
FN:qrd°by
TEL;WORK:+43 (0)1997 2742-0
EMAIL;INTERNET:office@qrd.by
ADR;INTL;PARCEL;WORK;CHARSET=utf-8:;;Deublergasse 37;Vienna;;1210;Austria;
END:VCARD
@magnum
magnum / tmux.conf
Created November 29, 2019 16:19 — forked from algesten/tmux.conf
A tmux.conf with pbcopy
# propagate titles to the window
set -g set-titles on
# Minimalist window title "0:bash"
set -g set-titles-string "#I:#W"
# show colors
set -g default-terminal "screen-256color"
@magnum
magnum / app assets javascripts rails_admin actions create_aliada_working_hours.js A complete rails admin custom action, the file of this gist are the paths were you should put your files
alert('omg hi!')
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@magnum
magnum / fiddle.css
Created July 16, 2021 13:12 — forked from stuk88/fiddle.css
Paper detection
.image:after {
display: block;
position: absolute;
width: 70%;
height: 70%;
border: 10px solid red;
}
video
{