Skip to content

Instantly share code, notes, and snippets.

View mikahanninen's full-sized avatar

Mika Hänninen mikahanninen

  • Robocorp
  • Finland
View GitHub Profile
@lucasdavila
lucasdavila / fixup.txt
Last active December 20, 2023 12:00
Fixing mac os yosemite issue "bash: fork: Resource temporarily unavailable"
# see the current limits
$ sysctl -a | grep maxproc
# increase it
$ sudo sysctl -w kern.maxproc=xxxx
$ sudo sysctl -w kern.maxprocperuid=xxx
# run at startup
$ sudo vim /etc/sysctl.conf
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@mkorpela
mkorpela / keyword_times.py
Last active February 4, 2024 11:40
Script that shows 100 most time consuming keywords in Robot Framework output.xml
from functools import total_ordering
from robot.api import ExecutionResult, ResultVisitor
import math, re
class KeywordTimes(ResultVisitor):
VAR_PATTERN = re.compile(r'^(\$|\@)\{[^\}]+\}(, \$\{[^\}]+\})* = ')
def __init__(self):
@susano
susano / csv_example.coffee
Last active December 13, 2015 21:59
Coffeescript CSV example
fs = require('fs' )
csv = require('csv')
FILENAME = 'sample.csv'
csv().from.path(FILENAME, columns: true)
.on('record', (row, index) ->
console.log("#{index} #{JSON.stringify(row)}"))
.on('end' , (count) ->
console.log("Number of lines: #{count}"))
@bartku
bartku / gist:4271798
Last active January 31, 2024 01:05
Unofficial description of unofficial World of Tanks API

World of Tanks unofficial API

World of Tanks, popular MMO game about tanks from time around WWII, has some nice mobile application called Wot Assistant (available also at AppStore and MS Marketplace). With simple packet sniffing you can guess how it retrieves players' statistics.

Surprisingly, mobile application uses quite simple API over HTTP which serves data in JSON, which is great help for people interested in creating own applications handling statistical data in game.

At this moment here is list of API features that has been discovered:

  • searching players by names
  • searching clans by names
@marcelom
marcelom / pysyslog.py
Created December 5, 2012 18:06
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
@nhoizey
nhoizey / screenshots.js
Created November 12, 2012 17:07
Take screenshots at different viewport sizes using CasperJS
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
@mub
mub / ubuntuToDev-12.10.sh
Created November 1, 2012 07:12
Ubuntu 12.10 tuning up for development
# This is a collection of shell snippets I used to tune up the Ubuntu 12.10 distribution to a development workstation without multimedia to run in a virt.
# Most of those commands were ran as root, see the first 2 comments under this code about getting to the root prompt in Ubuntu.
# now let's start with fresh Ubuntu install.
# toss out all this stuff, games, thunderbird (got Outlook on the Windows 7 host), samba (using VMWare's shared folders instead),
# pidgin (Using Lync on the host) etc, anything that eats up the space and clutters menus without giving me any leverage:
apt-get remove --purge --ignore-missing gbrainy aisleriot gbrainy gnome-games-* gnome-sudoku gnomine libgme0 mahjongg bogofilter* empathy* thunderbird* \
remmina gwibber* tomboy avahi-daemon transmission-* whoopsie samba* modemmanager ubuntuone* rhythmbox* activity-log-manager-common python-zeitgeist \
zeitgeist-core deja-dup pidgin* apport*
@gillibrand
gillibrand / air_hockey.py
Created August 6, 2012 05:38
An Air Hockey game for Pythonista on iPad and iPhone. Yes, I typed this all on my iPad. A little painful.
# Hockey
#
# A air hockey game for two players. First to
# seven wins.
# Most of the game is drawn with the scene
# module. Goal and winner messages are animated
# with layers.
from scene import *
from sound import *
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik