Skip to content

Instantly share code, notes, and snippets.

View sciotta's full-sized avatar
🎯
Focusing (also in Gitlab)

Thiago Sciotta sciotta

🎯
Focusing (also in Gitlab)
View GitHub Profile
@sciotta
sciotta / ComposeProviders.tsx
Last active May 10, 2023 05:07 — forked from Luisgustavom1/ComposeProviders.tsx
Compose React Providers to avoid too much chaining
import React from 'react'
interface IProviderProps {
component: React.ElementType,
props?: Record<string, any>,
}
interface IComposeProvidersProps {
with: Array<IProviderProps>,
children: React.ReactNode,
@sciotta
sciotta / rasterize.js
Created March 7, 2017 23:56
PhantomJS to Create PDFs from HTML
"use strict";
var page = require('webpage').create(),
system = require('system'),
address, output, size, pageWidth, pageHeight;
if (system.args.length < 3 || system.args.length > 5) {
console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]');
console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"');
console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px');
console.log(' "800px*600px" window, clipped to 800x600');
<div ng-repeat="m in milestone_choices" class="row-fluid">
<label><input type="radio" name="meaningless" ng-value="$index" ng-model="milestone_data.index" />
&nbsp;<span ng-bind="m.title"></span></label>
</div>