This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var less = require('gulp-less'); | |
var plumber = require('gulp-plumber'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var lesses = ['src/less/**/*.less']; | |
gulp.task('less', function () { | |
return gulp.src(lesses) | |
.pipe(sourcemaps.init()) | |
.pipe(plumber()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Rx = require('rx'); | |
Rx.Observable.prototype.mapParallel = function (fn) { | |
return this.concatMap((v) => Rx.Observable.fromNodeCallback(fn)(v)); | |
}; | |
Rx.Observable.prototype.mapSeries = function (fn) { | |
return this.concatMap((v) => Rx.Observable.defer(() => Rx.Observable.fromNodeCallback(fn)(v))); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = 'ubuntu/trusty64' | |
config.vm.provision 'shell', inline: <<-SCRIPT | |
curl -sL https://deb.nodesource.com/setup_4.x | bash | |
apt-get upgrade -y | |
apt-get install -y nodejs build-essential unionfs-fuse | |
SCRIPT | |
config.vm.provision 'shell', privileged: false, inline: <<-SCRIPT | |
mkdir ~/.src ~/src | |
unionfs-fuse -o cow ~/.src=RW:/vagrant=RO ~/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function formatDate($time, $format = 'Y年M月d日 H時m分s秒', $timezone = null) { | |
$cal = IntlCalendar::createInstance($timezone, 'ja_JP@calendar=japanese'); | |
$fmt = IntlDateFormatter::create('ja_JP', null, null, null, $cal, $format); | |
return $fmt->format($time); | |
} | |
echo formatDate(time(), 'Gy年') . PHP_EOL; | |
// => 平成27年 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$app = new \Silex\Application(); | |
$app->get('/hello', function () { | |
return 'Hello, world!'; | |
}); | |
$app->error(function ($ex) use ($app) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iterator> | |
template <typename T> | |
class IncreasingNumberIterator: public std::iterator<std::input_iterator_tag, T> | |
{ | |
private: | |
T n_; | |
public: | |
IncreasingNumberIterator(T n): n_(n) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MovingAverageFilter extends PIXI.AbstractFilter { | |
static fragmentSrc(size: number, width: number, height: number, direction: string) { | |
return ` | |
precision lowp float; | |
varying vec2 vTextureCoord; | |
varying vec4 vColor; | |
uniform sampler2D uSampler; | |
void main(void) | |
{ | |
gl_FragColor = vec4(0.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="WpfApplication1.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:WpfApplication1" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="350" Width="525"> | |
<Grid> | |
<Button Content="Hello!" Command="{Binding DoSomething}"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
class Queue { | |
constructor() { | |
this.running = false; | |
this.items = []; | |
} | |
enqueue(fn) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows; | |
using System.Windows.Data; | |
namespace WpfApplication1 | |
{ | |
public class DependencyPropertyTracker : DependencyObject | |
{ | |
public object Value | |
{ |
OlderNewer