Skip to content

Instantly share code, notes, and snippets.

View andreineculau's full-sized avatar
:bowtie:

Andrei Neculau andreineculau

:bowtie:
View GitHub Profile
@andreineculau
andreineculau / email.html
Last active August 29, 2015 14:01
github beacon - marking notifications as read when opened via mail
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>
Reply to this email directly or <a href='https://github.com/isakb/simple-proxy/issues/3#issuecomment-43875699'>view it on GitHub</a>.
<img src='https://github.com/notifications/beacon/708161__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxNjM3NzExMiwiZGF0YSI6eyJpZCI6MzI3MTYwMDV9fQ==--5d68bbf2d63b40a9a277783eeefff33eaa905f99.gif' height='1' width='1'>
</p>
@andreineculau
andreineculau / 1.pre.sh
Last active October 26, 2016 13:52
Jenkins - kill all subprocesses in the pre- or post-build phase
set +x
# Add this as the 1st build Exec shell
# Only for situations where you have 1 and only 1 executor per machine
# And you don't care about processes being left running after the job run ends
# Look for processes that have a BUILD_ID env var
# that is NOT the same as the current job's BUILD_ID
# nor same as dontKillMe
echo "Killing orphan spawned processes..."
@andreineculau
andreineculau / license.sh
Created March 18, 2014 08:33
Searching for NPM/Bower licenses
#!/usr/bin/env bash
function jqq() {
jq -r "$@" 2>/dev/null
}
function grepq() {
grep -q -w "$@" 2>/dev/null
}
@andreineculau
andreineculau / lock-my-mac.sh
Created January 28, 2014 20:33
lock my mac
#!/usr/bin/env bash
# Ask for the administrator password upfront
sudo -v
# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
@andreineculau
andreineculau / aliases.sh
Created October 8, 2013 10:56
bash timer
# After seeing that Mac AppStore has all these timers (both dumb and "smart") that each cost 3 USD (for what?!),
# I think this will do for 0 USD and 5 minutes.
# Works wonders as `timer 5 fuck off` :)
[[ "`uname`" == 'Linux' ]] && alias say="espeak"
function timer() {
minutes=${1:-1}
steep=$(($minutes*60))
wakeup=${@:2}
wakeup=${wakeup:-"time's up"}
@andreineculau
andreineculau / gist:5970012
Created July 10, 2013 20:25
andreineculau: Programming is not only syntax/semantics. Leave that to a readability/simplicity benchmark. Focus on models, patterns, higher level stuff

rambling re: tweet

By no means do I want to sound assertive. I lack a lot of knowledge in the area, so please slap me and set me straight, teach me a thing or two. The only thing that I standby is that it is stupid to explain syntax, to re-invent syntax, to argue about syntax, to have a liberal syntax, etc. Whatever does not matter (i.e. produce added value) should be standardized IMO. Eliminate mundane topics from the discussion to elevate the quality level. There are better things to do. That said readability, performance, simplicity, portability, ... still matter. A lot, I'd say.

Dictionary to level-off the communication

  • syntax - something that a parser can recognize e.g. PEG; the string 'function'
  • semantics - something that a parser can associate syntax to. e.g. AST/parse tree; the fact that the string 'function' is associated with the concept of a function
  • higher level stuff - paradigms (OOP, FP, LP, etc), models/concepts (monads, clas
@andreineculau
andreineculau / fun.erl
Created April 25, 2013 13:57
Escape strings so that they are not treated as Regular Expressions JavaScript, Erlang
re:replace(Str, "[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\,\\\\\^\\$\\|\\#\\s\\&]", "\\\\&", [global]).
@andreineculau
andreineculau / gist:5426128
Last active December 16, 2015 11:18
Online projects/ideas revolving around github repos and gists