Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastian ssuperczynski

View GitHub Profile
@ssuperczynski
ssuperczynski / LoginSuccessHandler.php
Created January 29, 2015 19:26
LoginSuccessHandler
View LoginSuccessHandler.php
<?php
namespace Acme\CommonBundle\Event;
use Acme\CommonBundle\Entity\User;
use Symfony\Component\Routing\Router;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
@ssuperczynski
ssuperczynski / RandomHttpLogGen.scala
Created March 29, 2016 14:41 — forked from ashrithr/RandomHttpLogGen.scala
Scala script to generate random http log events to a output file specified, one can specify the number of events to generate per second. Also, class IPGenerator can take in number of sessions and session length which can be used to simulate a user returning back.
View RandomHttpLogGen.scala
#!/bin/sh
exec scala -savecompiled "$0" "$@"
!#
import scala.collection.mutable.Map
import scala.util.Random
import scala.collection.mutable.ArrayBuffer
import java.io._
class IPGenerator(var sessionCount: Int, var sessionLength: Int) {
View keybase.md

Keybase proof

I hereby claim:

  • I am ssuperczynski on github.
  • I am ssuperczynski (https://keybase.io/ssuperczynski) on keybase.
  • I have a public key whose fingerprint is 9260 F6A4 4111 5CB2 71BC 91A2 2C03 4880 D115 3FEE

To claim this, I am signing this object:

@ssuperczynski
ssuperczynski / 00-about-search-api-examples.md
Created August 30, 2016 21:15 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API
View 00-about-search-api-examples.md
@ssuperczynski
ssuperczynski / .js
Created July 26, 2017 14:26
ES next Private field
View .js
class Dog {
#x = ‘wow’;
speak() { this.#bork(); }
#bork() {
return this.#x;
}
}
@ssuperczynski
ssuperczynski / .js
Created July 26, 2017 14:27
ES5 private field
View .js
var Dog = (function () {
var Dog = function () {
this.x = "wow";
}
Dog.prototype.speak = function () {
bork.call(this);
}
var bork = function () {
@ssuperczynski
ssuperczynski / .js
Created July 26, 2017 14:28
ES next flatMap
View .js
[[0], [1, 2], [3]].flatMap()
@ssuperczynski
ssuperczynski / .js
Created July 26, 2017 14:29
ES6 flatMap
View .js
const myArray = [[0], [1, 2], [3]];
const flatMap = (value) => {
return Array.isArray(value) ?
[].concat(...value.map(x => flatMap(x))) :
value;
}
@ssuperczynski
ssuperczynski / .js
Created July 26, 2017 14:29
ES next await function
View .js
for await (const line of readLines(filePath)) {
console.log(line);
}
@ssuperczynski
ssuperczynski / .js
Created July 26, 2017 14:30
ES next dynamic import
View .js
const main = document.querySelector("main");
for (const link of document.querySelectorAll("nav > a")) {
link.addEventListener("click", e => {
e.preventDefault();
import(`./section-modules/${link.dataset.entryModule}.js`)
.then(module => {
module.loadPageInto(main);
})
.catch(err => {