Skip to content

Instantly share code, notes, and snippets.

View ichiriac's full-sized avatar
🚀

Ioan CHIRIAC ichiriac

🚀
View GitHub Profile
/**
* JavaScript runtime-augmented scope example.
*/
let x = 10;
let o = {x: 30};
let storage = {};
(function foo(flag) {
/**
* JavaScript dynamic `this` value.
*/
function produce() {
console.log(this.x);
}
const alpha = {produce, x: 1};
const beta = {produce, x: 2};
/**
* JavaScript static scope example.
*/
const x = 10;
function print_x() {
console.log(x);
}
@GerHobbelt
GerHobbelt / grammar-extract.jison
Last active February 13, 2024 13:50
snip&snap extracts from our major JISON grammar file, showcasing 'code sections' a la BISON plus a few other bits & tricks. Note the %{ ... %} sections which are JISON's 'code sections'. Also note the code following that last '%%' marker: that is another 'code section' - and the most important one.
%options ranges
%options backtrack_lexer
/*
* lexical grammar
* ===============
*
* This section defines the lexer rules for our formula parser. The rules are checked from top to bottom, so order is import
* here!
*
@eligrey
eligrey / leaks.md
Last active November 22, 2023 23:14
Entities that have sold or leaked my personal data

Eli's leak list

The following entities have either sold or leaked personal data about me, including email addresses and phone numbers. Be wary of sharing your data with them.

Email addresses

These entities have either sold or leaked specific unique email addresses of mine to unauthorized parties, such as spammers.

@ichiriac
ichiriac / beaba-sample-rest.php
Created August 15, 2012 18:48
A beaba REST sample
<?php
// include the beaba framework before ...
$app = new beaba\core\WebApp(array(
'layouts' => array(
'profile/view' => function( $app, $data ) {
echo '<h1>Profile</h1>';
echo '<p> Name : ' . $data['name'] . '</p>';
echo '<p> Email : ' . $data['email'] . '</p>';
}
),