Skip to content

Instantly share code, notes, and snippets.

View akhoury's full-sized avatar
🏠
Working from home

Aziz Khoury akhoury

🏠
Working from home
View GitHub Profile
This file has been truncated, but you can view the full file.
[nodebb-plugin-import] importer.success Importing 5000 topics.
isUserAllowedTo topics:create 1049 [ '2' ]
isGuestAllowedTo topics:create [ '2' ]
isGuestAllowedTo:result topics:create [ '2' ] result: true
privileges.categories.can=topics:create cid=2 uid=2 result=true
isUserAllowedTo topics:create 904 [ '2' ]
isUserAllowedTo:result topics:create 1049 [ '2' ] result:false
privileges.categories.can=topics:create cid=2 uid=2 result=false
isGuestAllowedTo topics:create [ '2' ]
isUserAllowedTo:result topics:create 904 [ '2' ] result:false
Moved here for maintenance with collaboration of @JonDum
see https://github.com/JonDum/ractive-multi-decorator
@akhoury
akhoury / robots
Last active August 29, 2015 14:11
robots.text to disallow all engines
User-agent: *
Disallow: /
var convert = require('./bbcode-to-markdown');
var testString = '[As always, if anyone, especially ENFPs, has any suggestions for changes or improvements, feel free to comment.]' +
'[SIZE="5"]ENFP: A Jungian Cognitive Function Analysis[/SIZE]' +
'[SIZE="3"]by simulatedworld[/SIZE]' +
'[URL="www.personalitynation.com"]www.personalitynation.com[/URL]' +
'[B]ENFP[/B], or [I]Extroverted iNtuitive Feeling Perceiver[/I], is a label borrowed from MBTI nomenclature and now applied to the Jungian Cognitive Function set [B]{Ne, Fi, Te, Si}[/B].' +
'[B]Dominant: Extroverted iNtuition (Ne)[/B]' +
'[I]"More than anything I need to feel like I\'m working toward some kind of meaningful change or improvement in people\'s lives. I have a lot of big ideas for making things better, and I get really excited about new ideas that point toward some kind of new direction or idea I hadn\'t thought of before. I usually try to have a lot of people I like around, both because I like having them to bounce my ideas
@akhoury
akhoury / gc2r.js
Last active August 29, 2015 14:13
// won't work, im dumb, I just realized that it's a cross-domain frame, initially I thought the frame-content is being written by the js script
var gc2r = (function() {
var hostPageStyle = ''
+ '@media screen and (max-width: 350px) {'
+ ' div.goog-bubble-content.gc-reset {'
+ ' width: auto !important;'
+ ' }'
+ ' div.goog-bubble-content.gc-reset, '
@akhoury
akhoury / palindromize.js
Last active December 22, 2015 03:23
palindromize a word if possible in O(n), if already a palindrom return it, otherwise return null
function palindromize(word) {
if (Array.isArray(word)) {
return word.map(palindromize);
};
if (!word) return null;
word = "" + word;
// single letter words? really? i don't know..
// https://codility.com/programmers/task/binary_gap/
/*
A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.
For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1. The number 15 has binary representation 1111 and has no binary gaps.
Write a function:
int solution(int N);
// https://codility.com/programmers/task/odd_occurrences_in_array/
/*
A non-empty zero-indexed array A consisting of N integers is given. The array contains an odd number of elements, and each element of the array can be paired with another element that has the same value, except for one element that is left unpaired.
For example, in array A such that:
A[0] = 9 A[1] = 3 A[2] = 9
A[3] = 3 A[4] = 9 A[5] = 7
A[6] = 9
@akhoury
akhoury / wtf
Created January 27, 2016 03:12
markdown-it RangeError
This file has been truncated, but you can view the full file.
<p><a target=\"_blank\" href=\"www.youtube.com/watch?v=FMTDwAFk0cA\">fluxualte the impending desicion come forth wollow willing to juxtapost the danger days of a carrion fairy next to a unicorn in the back of the shed it is a sado macsohist anomanyus to situate forthcoming streams of desire flavored trees sapping and snorting in rainbow discharge talking like a mouldy yak infecting the demons **♣ lucky charms ♣ ** online profile eat a facebook field svksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksksvksvksvksvksvkssudghawdugh fluxualte the impending desicion come forth wollow willing to juxtapost the danger days of a carrion fairy next to a unicorn in the back of the shed it is a sado macsohist anomanyus to situate forthcoming streams of desire flavored trees sapping and snorting in rainbow discharge talking like a mouldy yak infecting the demons **♣ lucky charms ♣ ** online profile eat a facebook field svksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksvksv
@akhoury
akhoury / cls-minimal-test-case.js
Created May 20, 2016 17:26
must require continuation-local-storage before others
/*
You must require CLS first,
In this example if you require request first, it closes over some dep before CLS could rewrite it
1. run it as it the first time.
2. then uncomment the first request and comment out the one at Line 15, then run it again.
*/
// var request = require('request');