Skip to content

Instantly share code, notes, and snippets.

View jimfilippou's full-sized avatar
:shipit:

Dimitrios Filippou jimfilippou

:shipit:
View GitHub Profile
@aidanharris
aidanharris / fontawesome.sh
Last active November 23, 2017 12:09
Displays a fontawesome cheatsheet in your terminal - Requires patched fonts such as nerd-fonts (https://github.com/ryanoasis/nerd-fonts)
#!/usr/bin/env bash
set -e
if [[ -z "$ENABLE_CACHING" ]]
then
export ENABLE_CACHING=1
fi
if [[ -z "$FONTAWESOME_CACHE" ]]
@lucsh
lucsh / aliases
Created October 1, 2017 21:58
Bash Aliases
# Aliases
alias cdrep='cd /Users/lucas/Documents/repos'
alias cd..="cd .."
alias ls='ls -GFh'
alias ll='ls -la'
alias fucking='sudo'
alias st='open -a "Sublime Text"'
alias at='open -a "Atom"'
alias alog='tail -f /var/log/apache2/error_log'
@dchowitz
dchowitz / es6-debugging-in-vscode.md
Last active August 30, 2023 06:23
Debugging ES6 in VS Code

Debugging ES6 in VS Code

My current editor of choice for all things related to Javascript and Node is VS Code, which I highly recommend. The other day I needed to hunt down a bug in one of my tests written in ES6, which at time of writing is not fully supported in Node. Shortly after, I found myself down the rabbit hole of debugging in VS Code and realized this isn't as straightforward as I thought initially. This short post summarizes the steps I took to make debugging ES6 in VS Code frictionless.

What doesn't work

My first approach was a launch configuration in launch.json mimicking tape -r babel-register ./path/to/testfile.js with babel configured to create inline sourcemaps in my package.json. The debugging started but breakpoints and stepping through the code in VS Code were a complete mess. Apparently, ad-hoc transpilation via babel-require-hook and inline sourcemaps do not work in VS Code. The same result for attaching (instead of launch) to `babel-node

@AoJ
AoJ / README.md
Last active February 8, 2019 00:16
Js vs C++ vs Rust in node.js

Test node.js peformance for fibonacci implemented with js, cpp and rust

  fibonacci(10)
  js   x 1,308,359 ops/sec ±1.84% (96 runs sampled)
  cpp  x 4,146,280 ops/sec ±1.70% (93 runs sampled)
  rust x 3,675,842 ops/sec ±1.21% (97 runs sampled)
  
  fibonacci(33)
  js   x  20.87 ops/sec ±2.32% (39 runs sampled)
 cpp x 77.82 ops/sec ±1.47% (69 runs sampled)
anonymous
anonymous / Sockets.java
Created January 20, 2016 15:25
package stackoverflow;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.*;
import java.util.Scanner;
public class Sockets {
public static void main(String... args) throws Exception {
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@jbgo
jbgo / git-recover-branch.md
Last active March 29, 2024 05:04
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@kitek
kitek / gist:1579117
Created January 8, 2012 17:50
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");