View JS Canvas Game Prototype
<script> | |
var fps = 30; | |
var time = 0; | |
var deltaTime = 1; | |
function Start() { | |
looper(); | |
} | |
function looper() { |
View LinqJS
/* LinQ for Javascript | |
* Author: Huy Tran - Email: kingbazoka@gmail.com | |
*/ | |
///////////////////////////////// | |
Array.prototype.first = function(condition) { | |
return this[0]; | |
} | |
Array.prototype.last = function(condition) { |
View blinkLed.c
int led = 13; | |
void setup() { | |
// đưa pin 13 về chế độ OUTPUT | |
pinMode(led, OUTPUT); | |
} | |
// hàm lặp chính - nơi xử lý tất cả mọi thứ cho một chương trình Arduino | |
void loop() { | |
digitalWrite(led, HIGH); // bật đèn |
View fadeLed.c
int led = 9; // khai báo pin output là pin số 9 | |
int doSang = 0; // biến lưu độ sáng của đèn | |
int tocDo = 5; // tốc độ mờ dần của đèn | |
void setup() { | |
// thiết đặt chế độ output cho pin 9 | |
pinMode(led, OUTPUT); | |
} | |
// chương trình chính |
View blinkWithoutDelay.c
// khai báo pin 13 | |
const int ledPin = 13; | |
// Các giá trị sẽ thay đổi | |
int ledState = LOW; // ledState - trạng thái của đèn LED | |
long previousMillis = 0; // thời gian của lần vừa xử lý | |
long interval = 1000; // biên độ chênh lệch thời gian - đây sẽ là thời gian cần delay | |
void setup() { |
View objcFoundation.m
#import <Foundation/Foundation.h> | |
@interface DaGiac: NSObject { | |
int a; | |
int b; | |
} | |
@property int a; | |
@property int b; | |
-(float) getDienTich; | |
@end | |
View bootstrap.showDialog.js
jQuery.showDialog = function (options) { | |
var settings = $.extend({ | |
confirm: true, | |
message: "Hurahhh!!!", | |
success: function () { }, | |
cancel: function () { } | |
}, options); | |
var clickedOK = false; | |
var html = '<div class="modal fade" id="modalDialog" tabindex="-1" role="dialog"> ' + | |
' <div class="modal-dialog modal-sm"> ' + |
View timeCounter.ino
#include <SPI.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_PCD8544.h> | |
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3); | |
int LED_PIN = 8; | |
int INP = 2; | |
int counter = 0; |
View tyrion.go
package main | |
import "fmt" | |
type Lannister struct{} | |
func (l *Lannister) Roar() { | |
fmt.Println("Hear me roar!!!") | |
} |
View tyrion-main.go
package main | |
func main() { | |
var tyrion = Lannister{} | |
tyrion.Roar() | |
} |
OlderNewer