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
vec3 p = vec3(vTexCoord / 4., 0) + vec3(1., -1.3, 0.); | |
p += .2 * vec3(sin(time / 16.), sin(time / 12.), sin(time / 128.)); | |
//Thanks to http://glsl.heroku.com/e#6904.0 | |
vec2 seed = p.xy * 4.0; | |
seed = floor(seed * resolution.x); | |
vec3 rnd = nrand3( seed ); | |
vec4 starcolor = vec4(pow(rnd.y,20.0)); | |
//Second Layer |
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
ctrl-l + ctrl-n --> create a new environment | |
ctrl-l + ctrl-e --> create a new environment, with the name being the word you just typed | |
shift-enter --> creates a new line in an item or enumeration list | |
ctrl-l + ctrl-p --> shows the commands |
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 scala.util.parsing.json._ | |
val result = JSON.parseFull(""" | |
{"name": "Naoki", "lang": ["Java", "Scala"]} | |
""") | |
result match { | |
case Some(e) => println(e) // => Map(name -> Naoki, lang -> List(Java, Scala)) | |
case None => println("Failed.") | |
} |
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 MidiLoader { | |
/** | |
*loads a midi file from disk and stores all notes in a nested Array List, using the Helper class "Note" | |
* needs some cleanup though | |
*/ | |
ArrayList<ArrayList<Note>> tracks; | |
long maxTicks = 0; | |
final boolean DO_PRINT = false; | |
MidiLoader(String fileName) { |
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
<style> | |
/* customizable snowflake styling */ | |
.snowflake { | |
color: #fff; | |
font-size: 1em; | |
font-family: Arial; | |
text-shadow: 0 0 1px #000; | |
} | |
@-webkit-keyframes snowflakes-fall{0%{top:-10%}100%{top:100%}}@-webkit-keyframes snowflakes-shake{0%{-webkit-transform:translateX(0px);transform:translateX(0px)}50%{-webkit-transform:translateX(80px);transform:translateX(80px)}100%{-webkit-transform:translateX(0px);transform:translateX(0px)}}@keyframes snowflakes-fall{0%{top:-10%}100%{top:100%}}@keyframes snowflakes-shake{0%{transform:translateX(0px)}50%{transform:translateX(80px)}100%{transform:translateX(0px)}}.snowflake{position:fixed;top:-10%;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;-webkit-animation-name:snowflakes-fall,snowflakes-shake;-webkit-animation-duration:10s,3s;-webkit-animation-timing-function:linear,ease-in-out;-webkit-animation-iteration-count:infinite,infinite;-webkit-animation-play-state:running,running;animation-name:snowflake |
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
for %%a in ("*.mkv") do ffmpeg -i "%%a" -c:v libxvid -qscale:v 2 "newfiles\%%~na.avi" | |
pause |
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
Add this to Packages/User/test-snippet.sublime-snippet | |
<snippet> | |
<content><![CDATA[ | |
\texttt{$SELECTION} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>tt</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!-- <scope>source.python</scope> --> |
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
public int getWidth(){ | |
return view.getContext().getResources().getDisplayMetrics().widthPixels; | |
} |
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
find . -name '*.h' -type f -exec grep -H 'WHAT YOU ARE LOOKING FOR' {} \; |
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
stage = new Stage(); | |
InputMultiplexer multiplexer = new InputMultiplexer(); | |
multiplexer.addProcessor(stage); | |
multiplexer.addProcessor(Gdx.input.getInputProcessor()); | |
Gdx.input.setInputProcessor(multiplexer); | |
// To be put inside each class extending `RenderingScreen`. | |
// In addition, in the key processing methods, should delegate to the rendering screen themselves | |
public void onKeyDown(int keycode) { |
OlderNewer