Skip to content

Instantly share code, notes, and snippets.

weighted_choices = [('Red', 3), ('Blue', 2), ('Yellow', 1), ('Green', 4)]
population = [val for val, cnt in weighted_choices for i in range(cnt)]
random.choice(population)
Verifying that +slashdashpipe is my blockchain ID. https://onename.com/slashdashpipe
(take 25 (squares-of (integers)))
@yellowsnow
yellowsnow / FILLFORM.md
Last active August 29, 2015 14:23
Fill form with input names (requires jquery in website)

Installation

Add a bookmark to your browser with the :

  • Name : Fill form
  • URL : below javascript URL
#build-pipeline-plugin-content {
background-color: none !important;
border-radius: 0;
}
#build-pipeline-plugin-content h1 {
display: none;
}
tbody.pipelineGroup {
@yellowsnow
yellowsnow / ExcelSheetReader.groovy
Last active August 29, 2015 14:10
YES SIR : Yet another Excel Sheet Simple Iterator Reader
import java.io.BufferedWriter
import java.io.File
import java.io.FileInputStream
import java.io.FileNotFoundException
import java.io.FileWriter
import java.io.FilenameFilter
import java.io.IOException
import java.util.ArrayList
import org.apache.poi.openxml4j.exceptions.InvalidFormatException
import org.apache.poi.ss.usermodel.Cell
@yellowsnow
yellowsnow / README.asciidoc
Last active August 29, 2015 14:08
genv : poor man's windows dev environment switcher (Windows 7+)

What’s this?

If you are unlucky like me and you are constrained to work under windows for your groovy / grails / Java development, you certainly miss tools like GVM

This is a poor man’s windows dev environment switcher, based on symbolic links and made for Windows 7 or higher. And yes, it’s a one line command line :)

You are even poorer? you use XP :) Don’t panic, if you don’t have mklink on your windows, check alternatives here Symbolic links on windows

/**
* Copyright 2013 Kai Sternad
* 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,
<link href="../core-scaffold/core-scaffold.html" rel="import">
<link href="../core-header-panel/core-header-panel.html" rel="import">
<link href="../core-menu/core-menu.html" rel="import">
<link href="../core-item/core-item.html" rel="import">
<link href="../core-icon-button/core-icon-button.html" rel="import">
<link href="../core-toolbar/core-toolbar.html" rel="import">
<link href="../core-menu/core-submenu.html" rel="import">
<link href="../paper-input/paper-input.html" rel="import">
<polymer-element name="my-element">