Skip to content

Instantly share code, notes, and snippets.

Gergely Nemeth gergelyke

Block or report user

Report or block gergelyke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gergelyke
gergelyke / en.js
Created May 15, 2018
1-1 English
View en.js
const en = {
translations: {
meta: {
name: 'English'
},
header: {
title: '1-1 Question Ideas'
},
howto: {
title: 'How I use this app?',
@gergelyke
gergelyke / apple.js
Created Jan 19, 2018
Private ES6 methods
View apple.js
const transformName = Symbol('private:transformName');
class Apple {
constructor () {
console.log('i am created')
}
[transformName] (name) {
return name.split('').reverse().join('');
}
View keybase.md

Keybase proof

I hereby claim:

  • I am gergelyke on github.
  • I am gergelyke (https://keybase.io/gergelyke) on keybase.
  • I have a public key ASBuTobbsUl8Z0Wjws_opsTzFRb2095pxd4x9y1n4gT7IQo

To claim this, I am signing this object:

@gergelyke
gergelyke / test.js
Created Apr 16, 2017
Array.pop() vs Array.length=0
View test.js
var arraySize = 10000
var a = []
var sumTime = 0
function setup () {
for (var i = 0; i < arraySize; i+=1) {
a.push(i)
}
}
View .gitignore
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
View memory-leak.js
const heapdump = require('heapdump')
const app = require('koa')()
const router = require('koa-router')()
const log = [];
router.get('/', function *(next) {
log.push(this.headers)
this.body = {
status: 'finding a leak'
@gergelyke
gergelyke / app.js
Created Jan 24, 2015
Tessel with OpsGenie
View app.js
function sendAlert (property, value) {
console.log('Sending alert... %s : %s', property, value);
var payload = {
apiKey: '',
message: ''
};
var options = {
host: 'api.opsgenie.com',
@gergelyke
gergelyke / User.js
Last active Aug 29, 2015
User model
View User.js
function userModel (options) {
var db;
if (!options.db) {
throw new Error('Options.db is required');
}
db = options.db;
return {
@gergelyke
gergelyke / config.js
Last active Feb 14, 2018
Configuration with a config.js file
View config.js
var url = require('url');
var config = module.exports = {};
var redisToGoConfig;
config.server = {
host: '0.0.0.0',
port: process.env.PORT || 3000
};
// look, a comment in the config file!
@gergelyke
gergelyke / index.js
Created Dec 14, 2014
NODE_PATH example
View index.js
var Car = require('model/Car');
You can’t perform that action at this time.