Skip to content

Instantly share code, notes, and snippets.

@rafaelsteil
rafaelsteil / snake.html
Last active Apr 20, 2019
A snake game in JS
View snake.html
<!DOCTYPE html>
<html>
<head>
<title>Snake</title>
</head>
<body>
<canvas id="canvas" width="400" height="400" style="border: 1px dashed black;"></canvas>
<script type="text/javascript">
@rafaelsteil
rafaelsteil / snippet4.js
Last active Jan 9, 2016
Documentation blog post snippet 4
View snippet4.js
/*
Updates data in the "Resume" sheet.
@today is the Date object from the day you want to update
@key is the sheet's column value you want to update, which
is the customer's first name followed by theorder id (like "Maria7865")
@type any of "new", "renew" or "change"
*/
function updateResumeSheet(today, key, type) {
// ...
}
@rafaelsteil
rafaelsteil / snippet3.js
Created Jan 9, 2016
Documentation blog post snippet 3
View snippet3.js
/*
Updates data in the "Resume" sheet
*/
function updateResumeSheet(today, key, type) {
// ...
}
@rafaelsteil
rafaelsteil / snippet2.js
Last active Jan 9, 2016
Documentation blog post snippet 2
View snippet2.js
/*
Returns the corresponding row number of a given month in the "resume sheet"
@month: The value of new date.getMonth() for the month you want
*/
function getResumeRow(month) {
/*
16 is the row number of Jan/15 in the sheet. It was chosen because the
previous months were already processed when this code was created.
Doing this way, it is easier to determine which line corresponds
to which month, without the need of a more complex routine.
@rafaelsteil
rafaelsteil / snippet1.js
Last active Jan 9, 2016
Documentation blog post snippet 1
View snippet1.js
function getResumeRow(month) {
return 16 + month;
}
View teste.xml
<ContentPage
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps">
<maps:Map HeightRequest="200" x:Name="Map" IsShowingUser="True"/>
</ContentPage>
View teste.js
for pageSet in pss
@searchPageIds.push {pageId: parseInt(pageId), pageSetId: pageSet.id} for pageId in pageSet.portrait.pages if pageSet.portrait?.pages?
@searchPageIds.push {pageId: parseInt(pageId), pageSetId: pageSet.id} for pageId in pageSet.landscape.pages if pageSet.landscape?.pages?
// *****************
var i, j, k, len, len1, len2, pageId, pageSet, ref, ref1, ref2, ref3;
for (i = 0, len = pss.length; i < len; i++) {
View package.json
{
"name": "nw-demo",
"main": "index-app.html",
"single-instance": true,
"dependencies": {
"cheerio": "~0.17.0",
"finalhandler": "~0.1.0",
"serve-static": "~1.4.3",
"sqlite3": "^3.0.5"
},
You can’t perform that action at this time.