Skip to content

Instantly share code, notes, and snippets.

View mmv's full-sized avatar

Miguel Ventura mmv

  • OutSystems
  • Portugal
View GitHub Profile
@mmv
mmv / npm-console-output.txt
Created February 27, 2018 19:45
Breaking npm
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! path C:\myproject\node_modules\requirejs\bin\r.js.2470650542
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\myproject\node_modules\requirejs\bin\r.js.2470650542' -> 'C:\myproject\node_modules\requirejs\bin\r.js'
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\myproject\node_modules\requirejs\bin\r.js.2470650542' -> 'C:\myproject\node_modules\requirejs\bin\r.js'
npm ERR! cause:
@mmv
mmv / type-symbols.ahk
Last active November 29, 2018 11:03
AutoHotKey script for quickly typing a bunch of symbols
; Alt+Gr is the modifier key that leaves a lot of room for improvement.
; so we add a few more useful modifiers here.
; em-dash is the one that made me start this whole script
<^>!-::SendInput —
<^>!b::SendInput β
<^>!m::SendInput µ
;; special shortcuts
:o:»osps::C:\Program Files\OutSystems\Platform Server\
const INITIAL_CREDIT = 3; // <-- try changing to a value like 30
// <-- to see the difference
const ITEMS_TO_PROCESS = new Array(10);
var count = 0; // number of items being processed
var flowControl = new Rx.Subject();
# usage: ./this final.jpg photo1.jpg photo2.jpg ...
DEST="$1"
shift
cp "$1" "${DEST}"
shift
for FILE in $*; do
convert $FILE $DEST -gravity center -compose lighten -composite $DEST;
done
// Stamp a message anywhere on your web page
jQuery(document).ready(function($) {
function genRandInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
$(document).on("click", function(e) {
if (e.target.tagName == "A") { return; }
else {
$('<div style="font-size: xx-large; font-weight: bold;">Charts be here!</div>')
@mmv
mmv / ingress_graph_damage.py
Created January 17, 2013 00:31
Graph ingress xmp burster damage according to attack position and level, and resonator placement
# graphs total damage of a XMP burster
# according to blast position
# i'm using pylab (from ipython)
# but python + numpy + matplotlib should do it
from pylab import *
from math import sin, cos, pi
# deployed resonator configuration
resonator_distance = [35] * 8