This file contains hidden or 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 UnityEngine; | |
static class Vector2Swizzles { | |
// swizzle of size 2 | |
public static Vector2 Swizzle_xx(this Vector2 a) { return new Vector2(a.x, a.x); } | |
public static Vector2 Swizzle_xy(this Vector2 a) { return new Vector2(a.x, a.y); } | |
public static Vector2 Swizzle_x0(this Vector2 a) { return new Vector2(a.x, 0); } | |
public static Vector2 Swizzle_x1(this Vector2 a) { return new Vector2(a.x, 1); } | |
public static Vector2 Swizzle_yx(this Vector2 a) { return new Vector2(a.y, a.x); } |
This file contains hidden or 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 QtQuick 2.4 | |
Item { | |
width: 400 | |
height: 600 | |
ListView { | |
anchors.fill: parent | |
model: _BE.model | |
delegate: Text { text: hello } |
This file contains hidden or 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
#N canvas 132 132 682 510 10; | |
#X obj 13 175 list-find; | |
#X obj 13 83 key; | |
#X obj 64 82 loadbang; | |
#X obj 452 39 inlet; | |
#X text 449 15 octave shift; | |
#X text 38 34 q w e r t y u i o p [ ]; | |
#X text 10 13 layout:; | |
#X obj 452 206 * 12; | |
#X obj 13 223 +; |
This file contains hidden or 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
\version "2.12.3" | |
% ========================= | |
% = Snippetss for Lilypond = | |
% ========================= | |
% | |
% snippets.ly | |
% Basic snippets for Lilypond projects | |
% | |
% Created by Takeshi Suzuki on 2010-11-30. |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import os | |
import sys | |
import signal | |
from random import randint | |
from PyQt5.QtGui import QGuiApplication | |
from PyQt5.QtQuick import QQuickView |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# this code is runnable in both Python 2 and 3 | |
from __future__ import print_function | |
import os | |
import sys | |
import signal | |
from PyQt5.QtGui import QGuiApplication |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import signal | |
from PyQt5.QtGui import QGuiApplication | |
from PyQt5.QtQuick import QQuickView | |
from PyQt5.QtCore import QUrl, QObject, QVariant, pyqtSlot | |
from PyQt5.QtQml import QQmlEngine, qmlRegisterType |
This file contains hidden or 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 | |
# source this in .bashrc | |
# changes PS1 prompt format to: | |
# | |
# ┌(user@host)─(err_code)─(time date)─(git branch)─(virtualenv) | |
# └─(~/working/directory) $ | |
# | |
# it's based on: | |
# http://bash.cyberciti.biz/guide/Changing_bash_prompt | |
# https://wiki.archlinux.org/index.php/Color_Bash_Prompt |
This file contains hidden or 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
# Java Swing JTree demo in Jython | |
import java | |
from java.awt import Dimension, GridLayout, Toolkit, BorderLayout | |
from javax.swing.event import TreeModelListener | |
from javax.swing import (JPanel, JButton, SwingUtilities, JTree, JFrame, | |
JScrollPane, JTextField, ImageIcon, ToolTipManager, | |
JSplitPane, JEditorPane) | |
from javax.swing.event import TreeModelEvent | |
from javax.swing.tree import (DefaultTreeCellRenderer, DefaultTreeCellEditor, |
NewerOlder