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
// Usage: | |
// p(instance)('privateMethod)(arg1, arg2, arg3) | |
class PrivateMethodCaller(x: AnyRef, methodName: String) { | |
def apply(_args: Any*): Any = { | |
val args = _args.map(_.asInstanceOf[AnyRef]) | |
def _parents: Stream[Class[_]] = Stream(x.getClass) #::: _parents.map(_.getSuperclass) | |
val parents = _parents.takeWhile(_ != null).toList | |
val methods = parents.flatMap(_.getDeclaredMethods) | |
val method = methods.find(_.getName == methodName).getOrElse(throw new IllegalArgumentException("Method " + methodName + " not found")) |
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
# kudos to https://github.com/drewlesueur | |
# stolen from here: https://github.com/blog/266-fast-forward-your-fork#comment-11535 | |
git checkout -b upstream/master | |
git remote add upstream git://github.com/documentcloud/underscore.git | |
git pull upstream master | |
git checkout master // [my master branch] | |
git merge upstream/master | |
git push origin master |
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
authors: | |
hanzou: | |
name: Hanzou Hattori | |
display_name: Hanzou | |
gravatar: c66919cb194f96c696c1da0c47354a6a | |
email: [email protected] | |
web: http://company.com | |
twitter: company | |
github: hhattori | |
jorgen: |
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
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
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
Answers http://stackoverflow.com/questions/10373318/mixing-in-a-trait-dynamically. | |
Compile as follows: | |
scalac Common_1.scala Macros_2.scala | |
scalac Common_1.scala Test_3.scala -cp <path to the result of the previous compilation> | |
Tested in 2.10.0-M3, will most likely not compile by the time 2.10.0 final is released, because we're actively rehashing the API. | |
However the principles will remain the same in the final release, so the concept itself is okay. | |
upd. Code updated for 2.10.0-M7. | |
upd. Code updated for 2.10.0-RC1. |
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
======================================== | |
Adriaan Moors | |
======================================== | |
= src/compiler/scala/tools/nsc/ast/TreeGen.scala | |
1dbcbd5 2012-02-17 75 // TODO: would be so much nicer if we would know during match-translation (i.e., type checking) | |
= src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala | |
2890714 2012-04-24 536 // TODO: clean this up -- there is too much information packked into makePatDef's `pat` argument | |
= src/compiler/scala/tools/nsc/backend/icode/GenICode.scala | |
a57ac60 2012-02-13 1107 var ctx1 = genLoad(selector, ctx, INT) // TODO: Java 7 allows strings in switches (so, don't assume INT and don't convert the literals using intValue) | |
= src/compiler/scala/tools/nsc/transform/Erasure.scala |
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
# Title: | |
# Octopress HTML5 Audio Tag | |
# http://antoncherkasov.me/projects/octopress-plugins | |
# Author: | |
# Anton Cherkasov | |
# http://antoncherkasov.me | |
# [email protected] | |
# Syntax: | |
# {% audio url/to/mp3 %} | |
# {% audio url/to/mp3 url/to/ogg %} |
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
# Title: MP3 tag for Jekyll | |
# Authors: Devin Weaver, Daniel Roos (youtube changes) | |
# Description: Allows mp3 tag to include mp3 files embedded into the post. | |
# It uses the player 'audio.js' from http://kolber.github.com/audiojs/ | |
# | |
# Install the plugin according to the manuel of the author by adding the necessary lines to the head-template | |
# and adding the files into the right directories. | |
# | |
# Please read my [blog post about it][2]. | |
# |
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
#!/bin/bash | |
#LICENSE | |
#To the extent possible under law, the author(s) have dedicated all | |
#copyright and related and neighboring rights to this software to the | |
#public domain worldwide. This software is distributed without any warranty. | |
#See <http://creativecommons.org/publicdomain/zero/1.0/>. | |
# ffcapture, a hacky script to stream/capture your desktop or a window | |
# REQUIRES ffmpeg, xwininfo and bc to be installed! |
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
import javafx.animation.Interpolator; | |
import javafx.animation.Transition; | |
import javafx.application.Application; | |
import javafx.scene.Scene; | |
import javafx.scene.layout.BorderPane; | |
import javafx.scene.shape.Ellipse; | |
import javafx.scene.shape.Rectangle; | |
import javafx.scene.shape.Shape; | |
import javafx.stage.Stage; | |
import javafx.util.Duration; |
OlderNewer