Skip to content

Instantly share code, notes, and snippets.

View pinscript's full-sized avatar

Alexander Berg pinscript

View GitHub Profile
Server Software: Apache/2.2.3
Server Hostname: www.mediaanalys.net
Server Port: 80
Document Path: /
Document Length: 44441 bytes
Concurrency Level: 10
Time taken for tests: 273.371 seconds
Complete requests: 1000
public partial class SiteMaster : System.Web.UI.MasterPage {
protected void Page_Load(object sender, EventArgs e) {
AssignContentLanguage();
}
protected void AssignContentLanguage() {
var currentPath = Request.Url.Query;
var contentLanguage = "sv";
if (currentPath.StartsWith("?no/")) contentLanguage = "no";
@pinscript
pinscript / gist:1248055
Created September 28, 2011 14:17
Copy title attribute to missing/empty allt attributes
<?php
$html = '<html>
<head>
</head>
<body>
<img src="foo.jpg" title="heheh" alt="" />
<img src="foo.jpg" title="heheh" />
<img src="foo.jpg" title="heheh" alt="blaha" />
</body>
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
namespace ilab {
class Program {
private delegate string StringManipulator(string input);
static void Main(string[] args) {
class Program {
private delegate void BottlesDelegate(int input);
static void Main(string[] args) {
IL();
Console.WriteLine("Done");
Console.ReadLine();
}
<?php
class Smash {
/**
* Combine all files with a certain extension in a directory into a single file
*/
public function smash_directory($directory, $extension, $output) {
$files = glob($directory . '*.' . $extension);
$smashed = '';
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
score_table = [
('fitta', -300),
('kuk', -300),
("jävla", -20),
("helvete", -70),
("skit", -40),
<?php
class FuturePostsWidget extends WP_Widget {
function __construct() {
}
function widget($args, $instance) {
$query = new WP_Query('post_status=future&order=DESC&showposts=10');
printf("%d future posts", count($query));
@pinscript
pinscript / index
Created February 7, 2012 15:13 — forked from anonymous/index
TJOCK NICE FIL!!
<?php get_header(); ?>
<?php if(is_front_page()): ?>
<div id="text" style="width: 600px;">
<?php else: ?>
<div id="text">
<?php endif; ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if(!is_front_page()): ?>
/*
* HtmlAgilityPack
*/
using System;
using System.Net;
using HtmlAgilityPack;
public class Program {
public static void Main(string[] args) {