Skip to content

Instantly share code, notes, and snippets.

/**
* 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();
@pylover
pylover / a2dp.py
Last active March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@jch
jch / rabbitmq-install-osx.md
Created April 28, 2012 23:48
Troubleshooting RabbitMQ installation on OSX via homebrew

Troubleshooting RabbitMQ installation on OSX via homebrew

brew update
brew install rabbitmq

To see if rabbitmq is running after following the installation instructions:

launchctl list | grep rabbit
> 48303	-	homebrew.mxcl.rabbitmq
@sachin-handiekar
sachin-handiekar / QuartzRoute.java
Created November 5, 2014 13:27
A simple scheduler using camel-quartz
package com.sachinhandiekar.examples;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
/**
* @author Sachin Handiekar
*/
public class QuartzRoute extends RouteBuilder {
@honza
honza / description.md
Last active January 4, 2022 00:54
Ranking algorithm - Lower bound of Wilson score confidence interval for a Bernoulli parameter All implementations use 95% probability.

Ranking algorithm

Lower bound of Wilson score confidence interval for a Bernoulli parameter

All implementations use 95% probability.

pos is the number of positive votes, n is the total number of votes.

Source

@jabley
jabley / oracle2mysql.sed
Created July 12, 2012 10:43
Help convert Oracle DDL to MySQL
s/NUMBER(22,0)/BIGINT/
s/NUMBER(9,0)/INT/
s/NUMBER(8,0)/INT/
s/NUMBER(6,0)/MEDIUMINT/
s/NUMBER(5,0)/SMALLINT/
s/NUMBER(3,0)/TINYINT/
s/NUMBER(2,0)/TINYINT/
s/NUMBER(1,0)/BIT/
s/NUMBER(16,2)/DECIMAL(16,2)/
s/NUMBER(11,2)/DECIMAL(11,2)/
@aembleton
aembleton / StringUtil.java
Created May 19, 2011 10:36
Useful String utility methods.
package utils;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;