Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!--
IIS configuration sections.
For schema documentation, see
%IIS_BIN%\config\schema\IIS_schema.xml.
Please make a backup of this file before making any changes to it.
private static final double[][] RGB_TO_LMS = {
{0.3811, 0.5783, 0.0402},
{0.1967, 0.7244, 0.0782},
{0.0241, 0.1288, 0.8444}
};
private static final double[][] LOG_LMS_TO_LAB = {
{0.5773502691896258, 0.5773502691896258, 0.5773502691896258},
{0.4082482904638631, 0.4082482904638631, -0.8164965809277261},
{0.7071067811865475, -0.7071067811865475, 0.0}
function onEdit() {
var cell = SpreadsheetApp.getActiveSheet().getActiveCell();
switch (cell.getColumn()) {
case 2:
insertTimestamp(cell, 'C');
break;
case 4:
insertTimestamp(cell, 'E');
break;
import socket
import atexit
import requests
import json
CURRENT_LOCATION = "level02-2.stripe-ctf.com"
class Webhook:
def __init__(self):
self.last_remote_port = 0
using Gtk;
int main(string[] args) {
Gtk.init (ref args);
try {
var builder = new Builder ();
builder.add_from_file ("crux.glade");
var window = builder.get_object ("other_window") as Window;
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="other_window">
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
def foo(argument)
array = []
some_loop.each do |i|
array[i] = { child: foo new_argument }
end
end
@davidboy
davidboy / gist:3137309
Created July 18, 2012 16:29
zomg yes!
davidboy@ve:~/statbot/data$ grep "\"total_mins:2:\d+\":\d+" counters --only-matching --perl-regexp
"total_mins:2:1":60
"total_mins:2:2":60
"total_mins:2:3":60
"total_mins:2:4":60
"total_mins:2:5":60
"total_mins:2:6":60
"total_mins:2:7":60
"total_mins:2:8":60
"total_mins:2:9":60
@davidboy
davidboy / conversion.php
Created June 6, 2012 16:03
markdown editor
$this->load->library('markdown');
$html = $this->markdown->convert("some markdown code");
@davidboy
davidboy / bugs.php
Created June 3, 2012 17:55
Bitesize!
<?php
# This is the address of the page we want to load on the launchpad api.
$addr = "https://api.staging.launchpad.net/1.0/elementary/?ws.op=searchTasks&tags=bitesize&status=Confirmed&status=Triaged";
# Connect to the launchpad api.
$file = fopen($addr, "r") or die('fail');
# Download and decode the json.
$bugs = json_decode(fgets($file))->entries;