Skip to content

Instantly share code, notes, and snippets.

View oroce's full-sized avatar

Róbert Oroszi oroce

  • Budapest, Hungary
View GitHub Profile
player
.use(seekBar)
.use(volumeControl);
player
.use(function(next) {
if (hasAccess) {
return watchLaterControl(next);
}
@oroce
oroce / app.js
Last active August 29, 2015 14:14 — forked from gergelyke/app.js
function sendAlert (property, value) {
console.log('Sending alert... %s : %s', property, value);
var payload = {
apiKey: '',
message: ''
};
var options = {
host: 'api.opsgenie.com',
@oroce
oroce / index.html
Created January 9, 2015 21:07
hammerjs + selenium
<html>
<head>
<script src="https://hammerjs.github.io/dist/hammer.js"></script>
<style>
#myElement {
background: silver;
height: 300px;
text-align: center;
font: 30px/300px Helvetica, Arial, sans-serif;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<style type="text/css">}
@media (max-width: 480px) {body {
background-color:green !important}
</style>
<style type="text/css">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<style type="text/css">
body {
background-color: yellow;
}
@media (max-width: 640px) {
@oroce
oroce / app.js
Last active April 27, 2025 15:42
Redirect express while keeping params
/*
URLs:
http://localhost:3000/arrive?foo=bar&utm_source=smart-redir
*/
var redirect = require('redirect-with-params');
var express = require('express');
var app = express();
app.use(redirect({
Function.prototype.uncurryThis=function(f){f=this;return function(){var a=arguments,b=[].slice.call(a,1);return f.apply(a[0],b)}}
@oroce
oroce / collection-header-sync.js
Created September 26, 2014 14:13
pseudo code (mostly)
Backbone.Collection.extend({
sync: function(method, model, options) {
options || options = {};
options.beforeSend = function(jqXhr) {
jqXhr.setRequestHeader('Range', this.params.get('from') + this.params.get('to'))
}.bind(this);
var xhr = Backbone.sync.call(this, method, model, options);
xhr.success(function() {
this.params.incr('page');
}.bind(this));
@oroce
oroce / scam.txt
Created September 24, 2014 13:20
Nigerian scam on linkedin
MyDear Robert Oroszi
I’m Barrister A Government Attorney Martins Gonbella. A Legal Practitioner by profession with over 18years of experience. By the grace of God, I was a legal adviser to the late Mr:Michael Oroszi,who died in a car Accident here in Port-Novo Benin.I am contacting you after reading your profile in the Internet.
I seek your consent to present you to the Bank as his Next of Kin. You will stand as the right beneficiary of his sum of $12.5 Million USD with the Bank and his un-supervised estate left behind. I will forward the details to you for perusal upon receiving your information as below,kindly send in your response to my private
email ( [email protected] ) for security reasons. Your full name: ................ Age: ....................... Occupation:
..................... Private e-mail address: ......... Mobile phone
number:............. Your country of residence: ......
Call For More Information +229 68924798
Best Regards
Barrister Martins Gonbella
@oroce
oroce / app.js
Created August 22, 2014 10:30
cls fun
//app.js
var cls = require('continuation-local-storage');
var uuid = require('node-uuid');
var model = require('./model');
app.use(function(req, res, next) {
var tid = uuid.new();
var ns = cls.createNamespace('request');
ns.set('tid', tid);
ns.bindEmitter(req);
ns.bindEmitter(res);