Skip to content

Instantly share code, notes, and snippets.

View djromero's full-sized avatar
⌨️
Working

Julián Romero djromero

⌨️
Working
  • Job&Talent
  • Madrid (Spain)
View GitHub Profile
@djromero
djromero / launch.json
Last active October 22, 2022 10:41
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "C/C++: clang++ build and debug active file",
"type": "cppdbg",
"request": "launch",
@djromero
djromero / most_allocated_objects.rb
Created October 16, 2022 09:31 — forked from JoshCheek/most_allocated_objects.rb
Finding locations of most allocated objects
require 'objspace'
def self.show_allocations(&block)
_ = ObjectSpace.trace_object_allocations &block
ObjectSpace
.each_object
.to_a
.filter_map do |obj|
file = ObjectSpace.allocation_sourcefile obj
line = ObjectSpace.allocation_sourceline obj
@djromero
djromero / pycurses.py
Created January 25, 2020 22:49 — forked from claymcleod/pycurses.py
Python curses example
import sys,os
import curses
def draw_menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Clear and refresh the screen for a blank canvas
stdscr.clear()
@djromero
djromero / vapor-3-notes.md
Last active February 16, 2019 21:12
First contact with Vapor
@djromero
djromero / replace_utf16.py
Created September 17, 2018 15:51
Replace text in UTF-16 Little Endian
#!python2
import sys
import codecs
name_in = sys.argv[1]
name_out = sys.argv[2]
with open(name_in, "rb") as input:
data = input.read()
@djromero
djromero / sendmail_setup.md
Created March 26, 2018 17:39 — forked from kany/sendmail_setup.md
Setup SENDMAIL on Mac OSX Yosemite
@djromero
djromero / settings.json
Created February 23, 2018 18:38
VS Code Settings
{
// Editor font
"editor.fontFamily": "Source Code Pro, Menlo, monospace",
"editor.fontSize": 13,
"editor.fontLigatures": true
}
@djromero
djromero / ssh.config
Created June 15, 2017 15:09
Add ssh keys to keychain in macOS Sierra+
# include in your ~/.ssh/config file
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/your-private-key
@djromero
djromero / json2yaml.sh
Last active June 8, 2017 19:42
json --> yaml
# convert JSON to YAML
# Requires: PyYAML
alias json2yaml="python -c 'import json;import yaml;import sys;print(yaml.dump(json.load(sys.stdin), default_flow_style=False))'"
# Usage:
curl example.com/whatever.json | json2yaml
@djromero
djromero / Dockerfile
Last active June 8, 2017 17:55
CentOS 6.9 with Python 3.6.0
FROM centos:6
ENV PYTHON_VERSION "3.6.0"
RUN yum install -y gcc make zlib-devel openssl-devel sqlite-devel bzip2-devel \
&& curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \
&& tar xvf Python-${PYTHON_VERSION}.tgz \
&& cd Python-${PYTHON_VERSION} \
&& ./configure --prefix=/usr/local \
&& make \