Skip to content

Instantly share code, notes, and snippets.

@gpuido
gpuido / designer.html
Last active August 29, 2015 14:22
designer
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@gpuido
gpuido / designer.html
Last active August 29, 2015 14:22
designer
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
function InsertCharacter ( str, totalLength, char=" " )
{
str = str + ""
if ( str.length >= totalLength ) {}
else { while (str.length < totalLength) { str += char} }
return str
}
@gpuido
gpuido / quantize.js
Created April 13, 2017 14:32 — forked from nrabinowitz/quantize.js
Javascript module for color quantization, based on Leptonica
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php
@gpuido
gpuido / bulmatoscss_gulpfile.js
Created July 30, 2017 11:35 — forked from kritollm/bulmatoscss_gulpfile.js
Converts Bulma CSS framework from SASS to SCSS
// Bulma to scss gulp script
// In your terminal
// 1. npm install -D sass-convert gulp bulma gulp-sass gulp-replace
// 2. gem install sass
var gulp = require("gulp"),
replace = require('gulp-replace'),
converter = require('sass-convert'),
sass = require('gulp-sass');
###
### Save this file as "install-software.ps1"
###
# check for elevated powershell
write-host -nonewline -fore cyan "Info: Verifying user is elevated:"
If (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
write-host -fore Red "NO"
return write-error "You must run this script elevated."
}
@gpuido
gpuido / gulp-tab.ps1
Created August 25, 2017 10:35 — forked from fearthecowboy/gulp-tab.ps1
Better gulp tab expansion script
# Copyright (c) 2014 Jason Jarrett
#
# Tab completion for the `gulp`
#
# Usage:
#
# To enable powershell <tab> completion for gulp you need to be running
# at least PowerShell v3 or greater and add the below to your $PROFILE
#
# Invoke-Expression ((gulp --completion=powershell) -join [System.Environment]::NewLine)
@gpuido
gpuido / test.cmd
Created August 25, 2017 10:38 — forked from fearthecowboy/test.cmd
Make a powershell script with a .cmd (or .bat) extension
@powershell -noninteractive "& ([Scriptblock]::Create( ((gc -raw '%~df0') -replace '^@powershell.*' ) )) %*" & goto :eof
###
### Example : Just use that first line in a .cmd file and it will execute this file with powershell!
###
param( $name, $lastname )
write-host -fore green "Well, hello $name $lastname"
<# Notes:
this works just fine from cmd (or powershell) - even with named parameters:
@gpuido
gpuido / Install-Stack.ps1
Created August 25, 2017 10:43 — forked from fearthecowboy/Install-Stack.ps1
Install software stack.
###
### Save this file as "install-software.ps1"
###
# check for elevated powershell
write-host -nonewline -fore cyan "Info: Verifying user is elevated:"
If (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
write-host -fore Red "NO"
return write-error "You must run this script elevated."
}
@gpuido
gpuido / associate-powershell.ps1
Created August 25, 2017 11:04 — forked from fearthecowboy/associate-powershell.ps1
Make PowerShell scripts runnable from anywhere ( ie, CMD.EXE, Explorer, Run Dialog, etc)
#==============================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.