Skip to content

Instantly share code, notes, and snippets.

View karupanerura's full-sized avatar
👷‍♂️
Please assign issue to me. but, I may be slow to respond.

karupanerura karupanerura

👷‍♂️
Please assign issue to me. but, I may be slow to respond.
View GitHub Profile
// windows: gcc -o uv_streem.exe uv_streem.c -luv -lws2_32 -lpsapi -liphlpapi
// unix: gcc -o uv_streem uv_streem.c -luv -lrt
#include <stdio.h>
#include <uv.h>
struct _task_t;
typedef void (*strm_cb)(struct _task_t *);
typedef struct _strm_stream {
#!/usr/bin/env perl
use strict;
use warnings;
use Plack::Request;
# run `plackup pinknoise.psgi` and access to http://0:5000/?s=<second> via browser
my $app = sub {
my $req = Plack::Request->new(shift);
@miyagawa
miyagawa / text.md
Last active August 29, 2015 14:05
Plack::Middleware::Session::Cookie vulnerability

Aug 11, 2014

Plack::Middleware::Session::Cookie 0.21 has a security vulnerability where it allows an attacker to execute arbitrary code on the server, when the middleware is enabled without a secret.

If you use Plack::Middleware::Session::Cookie, you're required to pass a secret option to the middleware. The value of the secret key must obviously be kept private.

  • Version 0.22 is released today, which gives you a big WARNING when it is enabled without a secret set.
  • Version 0.23 TRIAL is released, which refuses to run without a secret set, giving an error message on the startup. This will become a non-trial release in a few days.

Solution

Backbone.Pjax = (function () {
"use strict";
var History = Backbone.History.extend({
"navigate": function(fragment, options) {
if (!Backbone.History.started) return false;
if (!options || options === true) options = {trigger: options};
fragment = this.getFragment(fragment || '');
if (this.fragment === fragment) return;
this.fragment = fragment;
@SaswatPadhi
SaswatPadhi / polyglot.pl.php.py.rb.cpp
Created June 5, 2012 03:33 — forked from wakhub/polyglot.pl.php.py.rb
PHP + Perl + Python + Ruby + C + C++ - polyglot
#/*<?php eval('echo "PHP Code\n";'); __halt_compiler();?> */
#include <stdio.h> /*
print ((("b" + "0" == 0) and eval('"Perl Code\n"')) or (0 and "Ruby Code\n" or "Python Code"));
__DATA__ = 1
"""""
__END__
@hagino3000
hagino3000 / method_missing.js
Last active January 16, 2020 13:11
__noSuchMethod__ for Chrome
/**
* Enable route to __noSuchMethod__ when unknown method calling.
*
* @param {Object} obj Target object.
* @return {Object}
*/
function enableMethodMissing(obj) {
var functionHandler = createBaseHandler({});
functionHandler.get = function(receiver, name) {