Skip to content

Instantly share code, notes, and snippets.

@roboter
roboter / math.cs
Last active August 29, 2015 13:57
math.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
/// http://www.smccd.net/accounts/hasson/C++2Notes/ArithmeticParsing.html
namespace MathParse
<pre>
<?php
$start_time = microtime(TRUE);
date_default_timezone_set("Europe/Tallinn");
$password_str = file_get_contents('passwords');
$passwords = explode("\n", $password_str);
$dictionary_str = file_get_contents('dictionary');
$dictionary = explode("\n", $dictionary_str);
prev_x = HERE_X
prev_y = HERE_Y
option = 0
direction = 0
NORTH = 1
SOUTH = 2
WEST = 3
EAST = 4
LOOP
@roboter
roboter / footerpartners.php
Created July 17, 2014 11:46
footerpartners
<?php $footerpartners = get_option('footerpartners'); ?>
<?php $footertabs = get_option('footertabs'); ?>
<?php if ( $footerpartners == '' ) $footerpartners = 'no'; else $footerpartners = get_option('footerpartners'); ?>
<?php if ( $footertabs == '' ) $footertabs = 'yes'; else $footertabs = get_option('footertabs'); ?>
<div id="footer-wrapper"<?php if ( $footertabs == 'no' && $footerpartners == 'no' ) echo ' class="footer-wrapper-no-content"'; ?>>
@roboter
roboter / boards.txt
Created July 18, 2014 14:05
Atmega16L arduino ISP programming
##############################################################
# Additional definitions for Arduino
# Author: Sudar <http://hardwarefun.com>
##############################################################
# Definitions for ATmega 8MHz
##############################################################
atmega16-8.name=Atmega16 (internal 8MHz clock)
atmega16-8.upload.protocol=stk500v1
atmega16-8.upload.maximum_size=14336
@roboter
roboter / handle.scad
Created October 8, 2014 07:41
Ручка для самовара
rotate_extrude($fn=20)polygon(points=[[2.8,0],[2.8,50],[7.8,50],[11.8,30],[11.8,20],[7.8,0],[2.8,0]],paths=[[1,2,3,4,5,6,7]]);
// Axle/Hub for Lego wheel.
// Connects M3 motor shaft on Tajima motor/gearbox kit to Lego splined axle wheel.
//
// Printed at 0.2mm layers on UP!. Build 45degree overhangs with no support
//
// Motor shaft hole can be HEX, ROUND, or ROUND with FLAT
// Using metal hex threaded standoff for M3 connection
// standoff is M3x10mm x5mm across flats JAYCAR HP0900
// standoff is press fit into hex hole. Hole has domed ceiling so prints without support
//
// Axle/Hub for Lego wheel.
// Connects M3 motor shaft on Tajima motor/gearbox kit to Lego splined axle wheel.
//
// Printed at 0.2mm layers on UP!. Build 45degree overhangs with no support
//
// Motor shaft hole can be HEX, ROUND, or ROUND with FLAT
// Using metal hex threaded standoff for M3 connection
// standoff is M3x10mm x5mm across flats JAYCAR HP0900
// standoff is press fit into hex hole. Hole has domed ceiling so prints without support
//
CREATE TABLE `workers` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`birthday` DATETIME NOT NULL,
`personalid` BIGINT(20) NOT NULL,
`active` ENUM('active','notactive') NOT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
<ul>
<?php foreach ( range( 1, 100 ) as $i ): ?>
<li><?php
$text = '';
if ( $i % 3 == 0 ) {
$text .= 'foo';
}
if ( $i % 5 == 0 ) {
$text .= 'bar';
}