Skip to content

Instantly share code, notes, and snippets.

View pinscript's full-sized avatar

Alexander Berg pinscript

View GitHub Profile
function jens($matches)
{
$path = '';
$parts = explode(',', $matches[1]);
foreach($parts as $match)
$path .= '/' . str_replace('\'', '', trim($match));
return $path;
}
@pinscript
pinscript / gist:884701
Created March 24, 2011 07:26
Flot tooltoips
$.plot($("#chart"), set, {
xaxis: {
mode: "time",
timeformat: "%y-%m-%d"
},
yaxis: {
tickFormatter: function(v) { return (parseInt(v, 10) / 1000) + " kkr";}
},
series: {
lines: { show: true },
using System;
using System.Xml.Serialization;
using System.IO;
namespace Scrap
{
class Program
{
static void Main(string[] args)
{
@pinscript
pinscript / Dynamic Dictionary
Created April 14, 2011 11:13
Dynamic Dictionary
using System.Linq.Expressions;
using Microsoft.CSharp.RuntimeBinder;
namespace Nancy
{
using System;
using System.Collections.Generic;
using System.Dynamic;
public class DynamicDictionary : DynamicObject, IEquatable<DynamicDictionary>
<?php
require_once 'outpost.php';
$app = new Outpost;
$app->before(function() {
echo "Running before filter<br /><br />";
});
$app->after(function() {
echo "<br /><br />Running after filter";
<?php
require_once 'lib/Ava.php';
$app = new Ava;
$app->using('domain');
$app->enable('diagnostics');
$app->get('/', function($r) {
$services = Service::all();
render('index', array('services' => $services));
Scenario: Index lists active orders
Given there are 2 active orders
Given there are 1 inactive orders
When i go to Index
Then i should see 2 active orders
Scenario: Requesting a single order
Given there are an order with id 1
When i want to show order with id 1
Then i should see order with id 1
html_data += '<li>';
html_data += '<a title="' + item.text + '" class="twitter item-' + i + '" href="' + item.url + '">';
html_data += '<img src="' + item.thumbnail + '" />' + '<span>' + item.date + '</span>' + item.text;
html_data += '</a>';
html_data += '</li>';
Kan bli:
<script id="twitter-template" type="text/x-jquery-tmpl">
<li>
table
{
width: 100%;
}
th
{
background-color: #EEEEEE;
background-image: -moz-linear-gradient(#E6E6E6, #D9D9D9);
border-bottom: 1px solid #B4B4B4;
padding: 10px;
function Storage() {
this.isSupported = function () {
try {
return !!localStorage.getItem;
} catch (e) {
return false;
}
};
this.get = function (name) {