Skip to content

Instantly share code, notes, and snippets.

// Run with
// casperjs test front-end.js 2> /dev/null
// to redirect ugly PhantomJS CTFontCreateWithName* errors
var siteURL = 'http://localhost:3000';
var clientDelay = 200; // delay 200ms
// Utility function, needed because Meteor static pages do not load instantly
casper.openWithClientDelay = function (url, fn) {
casper.thenOpen(url, function () {
@cdinu
cdinu / translit.js
Created February 12, 2014 12:17
Transliterate Romanian Alphabet to Cyrilic
(function() {
// the minimum version of jQuery we want
var v = "1.3.2";
// check prior inclusion and version
if (window.jQuery === undefined || window.jQuery.fn.jquery < v) {
var done = false;
var script = document.createElement("script");
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js";
script.onload = script.onreadystatechange = function() {
/**
Go to: https://developers.facebook.com/tools/explorer/
Then get access token: permissions, friends, current_location, hometown
FQL Query:
SELECT name, current_location.city, hometown_location.city
FROM user
WHERE uid in (SELECT uid2 FROM friend WHERE uid1=me())
@cdinu
cdinu / program-enescu.md
Last active August 29, 2015 14:07
Varianta actualizată

FESTIVALUL INTERNAŢIONAL „GEORGE ENESCU“

România, 30 august – 20 septembrie 2015
Ediţie desfăşurată sub înaltul patronaj al Preşedintelui României
Director artistic: Ioan Holender
Producător: Guvernul României prin Ministerul Culturii şi Patrimoniului Naţional
Coproducători: Societatea Română de Radiodifuziune
Societatea Română de Televiziune
Organizator: ARTEXIM

@cdinu
cdinu / program-enescu.en.md
Created October 20, 2014 13:39
program-enescu.en.md
<style> .series-tag { color: white; background: red; font-family: sans-serif; padding: 6px 8px; font-size: 80%; border-radius: 6px; }
@cdinu
cdinu / gist:3d7ecc43b53dc24e8630
Created December 3, 2014 13:25
One liner to add LFA modules
for i in backstage exercises classroom; do git submodule add git@github.com:learnfwd/lfa-addon-$i.git addons/lfa-$i; done
# then modify js/main.js mixins/main.jade css/master.styl
@cdinu
cdinu / gist:5fed011effc9748ede9b
Created April 14, 2015 12:07
Fountainhead Highlights

But that I knew it over twenty-five years ago—that I knew it while The Fountainhead was being rejected by twelve publishers, some of whom declared that it was “too intellectual,” “too controversial” and would not sell because no audience existed for it—that was the difficult part of its history; difficult for me to bear. I mention it here for the sake of any other writer of my kind who might have to face the same battle—as a reminder of the fact that it can be done.

“I want to see, real, living, and in the hours of my own days, that glory I create as an illusion. I want it real. I want to know that there is someone, somewhere, who wants it, too. Or else what is the use of seeing it, and working, and burning oneself for an impossible vision? A spirit, too, needs fuel. It can run dry.”

neither of us has ever wanted or been tempted to settle for anything less than the world

He convinced me of why one cannot give up the world to those one despises.

“My dear fellow, who will let you?” “That’s not the point. Th

@cdinu
cdinu / ndf.js
Created August 26, 2015 15:14
Detect duplicates in LFA exercise names
#!/usr/local/bin/node
/*
Install: save this file on an Unix-like system (Linux / OSX / Cygwin)
Put it in path and make it executable:
sudo cp ndf.js /usr/local/bin
sudo chmod a+x ./ndf.js
Usage: ndf.js $(find . -type f -print)
@cdinu
cdinu / getxypercent.js
Created September 25, 2015 13:42
Get XY coordinates as percentages
// 1. Load an image in a new tab
// 2. Open JS console. Leave it open
// 3. Paste this
var s = document.createElement('script');
s.setAttribute('src','https://code.jquery.com/jquery-2.1.4.min.js');
document.head.appendChild(s);
// 4. Then paste this
var oldx = 0, oldy = 0;
@cdinu
cdinu / qna.md
Last active February 7, 2016 16:43
Interview prep Learn Forward

De cat timp faceti manuale electronice? O sa va rog sa descrieti foarte pe scurt si pe intelesul unor oameni simpli ce face un manual electronic produs de dumneavoastra. Care e diferenta fata de manualele electronice din sistemul de invatamant romanesc.

Learn Forward face manuale electronice de trei ani.

  • În martie 2013 am lansat în colaboare cu Holcim într-un proiect CSR ceea ce a fost recunoscut de Ministerul Educației drept "Primul Manual Digital". Detalii aici și aici. Această tehnologie nu o mai folosim pentru că deși era extrem de ușor de folosit mergea doar pe iPad-uri și calculatoare Apple. (aceasta este prima iterație)

  • În septembrie 2013 am lansat în colaborare cu Samsung, sistemul de management al învățării (Learning Management System) destinat claselor lor digitale din România și Bulgaria. În urma discuțiilor cu profesorilor am aj