Skip to content

Instantly share code, notes, and snippets.

@PARC6502
PARC6502 / nopickle.py
Created July 26, 2014 13:23
Can't Save
from kivy.storage.dictstore import DictStore
from kivy.event import EventDispatcher
from kivy.properties import ListProperty
store = DictStore('test.dict')
class TestClass(EventDispatcher):
tasks = ListProperty([{'in_cats': [], 'deleted': False, 'type': 'task', 'id': 0, 'name': 'Task1'}, {'in_cats': [], 'deleted': False, 'type':'task', 'id': 1, 'name': 'Task2'}])
@PARC6502
PARC6502 / drop_test.py
Created August 7, 2014 17:45
Issue with DropDown
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.factory import Factory
Builder.load_string("""
<MainView>:
cols: 1
size_hint_y: None
height: self.minimum_height
/* Sheet 4 Exercise B
* Written by: Ibrahim El-Serafy (Ibby)
* First written: 18/10/2016
* Last updated: 25/10/2016
*/
import sheffield.*;
public class Exercise4b {
public static void main(String[] args) {
final String SPACE = " ";
final String STAR = "*";
How many pounds? 12
How many shillings? 3
How many pence? 4
That is 12.17 in decimal currency
16.67 in old money is L16.13s.4d
Old L s d
16.67 16 13 4
97.75 97 15 0
How many pounds? 1
import React, {Fragment} from 'react';
const HomePage = props => {
return (
<Fragment>
<h2>The heading</h2>
<div className="centered"><TheImage /></div>
</Fragment>
);
};
@PARC6502
PARC6502 / ReactCssUI.md
Last active August 3, 2018 08:27
React, Css, and UI Notes

React inline style systems

  • jsxstyle: jsxstyle is an inline style system for React and Preact. It provides a best-in-class developer experience without sacrificing performance, and has little regard for existing CSS orthodoxy. Styles are written inline on a special set of components exported by jsxstyle. Inline styles on these components are converted to CSS rules and added to the document right as they’re needed.
  • styled-components: Utilising tagged template literals (a recent addition to JavaScript) and the power of CSS, styled-components allows you to write actual CSS code to style your components. It also removes the mapping between components and styles – using components as a low-level styling construct could not be easier! styled-components is compatible with both React (for web) and React Native – meaning it's the perfect choice even for truly universal apps! See the documentation about React Nativ
import styled from 'styled-components';
const CustomButton = styled.button`
background: papayawhip;
width: 100%;
`
export default CustomButton;
@PARC6502
PARC6502 / p5init.sh
Last active February 16, 2019 19:08
Copies over an empty p5 file
#A script to initialise a p5 folder
SOURCEDIR="~\p5templates\empty-example"
getopts 'g' flag;
if [[ "${flag}" == "g" ]]; then
SOURCEDIR="~\p5templates\generative-library"
fi
# I guess this line removes the g flag for cp...
@PARC6502
PARC6502 / sketch.js
Created March 4, 2019 17:06
Sketch file for CCapture
let step = 3;
let framerate = 30;
// Create a CCapture object
var capturer = new CCapture( {
format: 'webm',
framerate,
name: 'noise_visualization',
quality: 100,
} );
@PARC6502
PARC6502 / 1-Open_Source_Overview.md
Last active March 5, 2019 14:18
Frameworks for creative coding

Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts.

Javascript implementation of processing, "reinterpreted for today's web"

openFrameworks is an open source C++ toolkit for creative coding

SuperCollider is a platform for audio synthesis and algorithmic composition, used by musicians, artists, and researchers working with sound.

Cinder is a free and open source library for professional-quality creative coding in C++.