Skip to content

Instantly share code, notes, and snippets.

@chimanaco
chimanaco / array.html
Created August 17, 2014 01:44
Display number from array
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Calculate decimal places</title>
</head>
<body style="">
<script>
@chimanaco
chimanaco / of_frequent_code
Last active May 15, 2016 11:33
oF to edit later
/* -------------------------------
DEBUG
------------------------------- */
/* prints Output sentence on screen */
cout << "DONE!: \n";
cout << "Position: " << position << "\n";
ofLog() << " event at " << f << endl;
/* -------------------------------
@chimanaco
chimanaco / es6.js
Last active January 24, 2017 09:31
JS to edit later
this.btn.on('click', ()=>{
this.onBtnClicked();
});
// Repeat
setInterval(()=>{
console.log('set setInterval!');
}, 250);
// Once
@chimanaco
chimanaco / pug.pug
Last active December 27, 2016 04:55
Pug Copy & Paste
ul#list
- len = data.list.length
- for(var i = 0; i < len; i++)
li(class='list ' + ' list-' + data.list[i].category data-groups='["' + data.list[i].category + '"]')
a(href='' + data.list[i].id + '/')
img.thumbImg(src='/common/movie_s/mobile/' + data.list[i].id + '/thumb.jpg')
p !{data.list[i].title} [!{data.list[i].location}]
// print data object
p !{JSON.stringify(data)}
@chimanaco
chimanaco / jQuery.js
Last active October 7, 2016 17:30
jQuery Copy & Paste
// Velociy
animation($target) {
$target.velocity(
{
opacity: 1
},
{
queue: false,
begin: () => {
console.log('animation begin', $target);
for num in (1..5)
.menu-{num}
background-image: url('/img/photo' + num + '.jpg');
@chimanaco
chimanaco / glsl.frag
Last active April 8, 2017 15:40
glsl.frag
// draw border with step
float drawBorder(vec2 st, float thickness) {
// bottom-left
vec2 bl = step(vec2(thickness),st);
// top-right
vec2 tr = step(vec2(thickness),1.0-st);
float pct = bl.x * bl.y * tr.x * tr.y;
return pct;
}

Can't work with vuejs-logger.

// Can't use arrow function with watch.
```
watch: {
mySeconds: 'send',
hour(newValue) {
// You can use this here
const tl = new TimelineMax();
tl.to(this, 0.5, {
animatedHour: newValue,
delay: 0,