Skip to content

Instantly share code, notes, and snippets.

@nagyv
nagyv / goaccess.py
Created May 6, 2014 15:37
A python script for downloading and processing Amazon S3 logs using goaccess
#!/bin/python
import os
from boto.s3.connection import S3Connection
import subprocess
from datetime import datetime, date
import argparse
import tempfile
import json
parser = argparse.ArgumentParser(description="Downloads logs from S3, and parses them with goaccess.")
@nagyv
nagyv / example.html
Created February 6, 2018 12:15
example html for an RN bug report
<!DOCTYPE html>
<html lang="en">
<head>
<script>
// from: https://github.com/facebook/react-native/issues/11594#issuecomment-274689549
function awaitPostMessage() {
let isReactNativePostMessageReady = !!window.originalPostMessage;
const queue = [];
let currentPostMessageFn = function store(message) {
if (queue.length > 100) queue.shift();
@nagyv
nagyv / WhoopsModal.js
Created September 8, 2017 09:09
Cannot read property 'state' of undefined
import React, { Component } from 'react'
// import PropTypes from 'prop-types';
import { View } from 'react-native'
import {
H1,
Icon,
Button,
Text
} from 'native-base'
import Modal from 'react-native-modal'
@nagyv
nagyv / gradlew logs
Created August 30, 2017 22:53
gradlew logs
C:\Users\Viktor\Projects\potzak\android\app\src\main\java\com\potzak\MainApplication.java:8: error: package com.learnium.RNDeviceInfo does not exist
import com.learnium.RNDeviceInfo.RNDeviceInfo;
^
C:\Users\Viktor\Projects\potzak\android\app\src\main\java\com\potzak\MainApplication.java:9: error: package com.lugg.ReactNativeConfig does not exist
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
^
C:\Users\Viktor\Projects\potzak\android\app\src\main\java\com\potzak\MainApplication.java:10: error: package com.microsoft.azure.mobile.react.crashes does not exist
import com.microsoft.azure.mobile.react.crashes.RNCrashesPackage;
^
C:\Users\Viktor\Projects\potzak\android\app\src\main\java\com\potzak\MainApplication.java:11: error: package com.microsoft.azure.mobile.react.analytics does not exist
@nagyv
nagyv / README.md
Created May 27, 2017 18:32
Mandrill API mocking in Nodejs

A simple way to mock calls to the Mandrill API from nodejs tests. It uses the amazing mockery package.

@nagyv
nagyv / README.md
Last active September 20, 2016 13:28
Git image diff

What it this for?

Have you ever wandered how to follow changes in images using git? This is a solution for the problem.

How to install

  1. Copy git-imgdiff.sh somewhere under your $PATH. Probably $HOME/bin.
  2. Create the $HOME/.gitattributes file with the following content ~/.gitattributes
@nagyv
nagyv / gist:2538496
Created April 29, 2012 07:10
Testing mongoose pre-save with async
var mongoose = require('mongoose'),
async = require('async'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var MyS = new Schema({
feeling: String
});
MyS.pre('save', function(done){
async.parallel([
@nagyv
nagyv / mongoose-test.js
Created April 4, 2012 13:37
The simplest Mongoose app to run
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var myS = new Schema({
name: {type: String, required: true}
});
var My = mongoose.model('My', myS);
var my = new My({'name': 'bika'});
@nagyv
nagyv / file1.js
Created March 17, 2012 16:48
Creating JSON request browser with Tobi
var tobi = require('tobi'),
browser = tobi.createBrowser(8000, "localhost");
json_browser = (function(){
var json_header = {headers:
{
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest"
}
};
@nagyv
nagyv / file1.js
Created March 11, 2012 22:46
Connecting to mongodb using a mongodb:// uri
var Db = require('mongodb').Db;
//...
options.noOpen = true;
myDb = Db.connect(mongouri, options);
// or
options.noOpen = false;