Skip to content

Instantly share code, notes, and snippets.

View SET001's full-sized avatar
🇺🇦

Kostiantyn Kostiuk SET001

🇺🇦
View GitHub Profile
class Cursor{
// @include components/d2.ts
create(){
}
}
@SET001
SET001 / textBox.js
Created November 11, 2016 23:50
PHASER.js textBox plugin
class TextBox{
constructor(x, y, game){
this.lineHeight = 20
this.lineNumber = 0
this.game = game
this.x = x
this.y = y
}
write(text){
const mkdirp = require('mkdirp')
const rmdir = require('rmdir')
const fs = require('fs')
rmdir('./media/01', (err)=>{
var path = './media/01/f1/'
mkdirp(path, (err)=>{
if (err) return err
const content = "asdasd"
fs.writeFile(path + 'file.jpg', content, (err)=>{
@SET001
SET001 / blah.js
Created September 18, 2016 21:31
defered not working
fit('should not put image in request', (done)=>{
defer = $q.defer()
defer.promise.then(function(){
console.log("blah")
done()
})
defer.resolve()
})
@SET001
SET001 / register.html
Created September 7, 2016 12:29
registration form with validation - angular
<h2>{{'common.register' | translate}}</h2>
<form class="form-horizontal" style="width: 500px; margin: 0 auto" ng-submit="send()" novalidate name="registerForm">
<div class="form-group">
<label for="email" class="col-sm-3">{{'common.email' | translate}}</label>
<div class="col-sm-9">
<input
type="email"
class="form-control"
id="email"
name="email"
@SET001
SET001 / autModle.ts
Created June 5, 2016 08:16
inversify ingecting factory
interface IAuthConnection{
logIn()
logOut()
register()
}
@injectable()
export class AuthConnection implements IAuthConnection{
connection: IConnection
constructor(
<?php
// [{"text":"asasadsd"}, {"text":"saasd dsf d"}, {"text":"oooooooooooololo","options":["sadasd", "asdsadsad","asdasdasd","asdasdsad"]}]
class questionariesActions extends sfActions{
public function preExecute(){
if ($id = $this->getRequest()->getParameter('id')){
$this->forward404Unless($this->questionary = EventQuestionaryPeer::getById($id), sprintf('Объект мероприятия с указанным id не существует (%s).', $id));
$this->breadcrumbs = array(
array('url' => $this->getController()->genUrl('@events_common'), 'label'=>'Список мероприятий'),
<?php
class Controller_Galleries extends Controller_API{
protected $_model = 'Gallery';
public $secure_actions = array(
'remove_image' => array('admin'),
'update_image' => array('admin'),
);
public function action_upload_image(){
<?php
class Controller_API extends Controller_Default{
public $auth_required = true;
public $user;
public $secure_actions = array(
'remove' => array('admin'),
'save' => array('admin'),
);
window._RTCPeerConnection = window.mozRTCPeerConnection || window.webkitRTCPeerConnection || window.RTCPeerConnection
window._RTCSessionDescription = window.webkitRTCSessionDescription || window.mozRTCSessionDescription || window.RTCSessionDescription;
window._IceCandidate = window.mozRTCIceCandidate || window.RTCIceCandidate
unless window._RTCPeerConnection then console.error 'Your browser doesn\'t support WebRTC'
navigator.getUserMedia = navigator.getUserMedia || navigator.mozGetUserMedia || navigator.webkitGetUserMedia
app.factory 'PeerConnection', ['$rootScope', 'XMPP', 'Config', '$q', 'Account','LocalStorage', ($rootScope, XMPP, Config, $q, Account, LSParams)->
class PeerConnection