Skip to content

Instantly share code, notes, and snippets.

@VladimirPal
VladimirPal / neomuttrc
Last active March 30, 2024 11:59
Minimal neomutt config for gmail imap
set imap_user="mail.vpal@gmail.com"
set imap_pass=`/usr/bin/security find-generic-password -w -a 'mail.vpal@gmail.com' -s 'Gmail'`
set folder=imaps://imap.gmail.com/
set spoolfile=+INBOX
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
# https://www.neomutt.org/guide/reference search sleep_time for additional info
set sleep_time=0 # be faster
# -*- coding: utf-8 -*-
import base64
import os
from django.conf import settings
from zeep import Client as ZeepClient
from suds.client import Client as SudsClient
from pac_gateway.cfd.models import Location
@teknoraver
teknoraver / unixhttpc.go
Last active July 8, 2024 10:12
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@0xjac
0xjac / private_fork.md
Last active July 24, 2024 23:13
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@JacobBennett
JacobBennett / blog.md
Last active June 7, 2024 17:42
Clean up your Vue modules with ES6 Arrow Functions

Recently when refactoring a Vue 1.0 application, I utilized ES6 arrow functions to clean up the code and make things a bit more consistent before updating to Vue 2.0. Along the way I made a few mistakes and wanted to share the lessons I learned as well as offer a few conventions that I will be using in my Vue applications moving forward.

The best way to explain this is with an example so lets start there. I'm going to throw a rather large block of code at you here, but stick with me and we will move through it a piece at a time.

<script>

// require vue-resource...

new Vue({
@Richzendy
Richzendy / Reglas_Principales_para_entrar_al_mundo_de_Wordpress.md
Last active February 28, 2020 13:11
Reglas Principales para entrar al mundo de Wordpress
  1. Empieza por leer (lo siento, está en inglés) el diccionario de terminología WordPress de la A-Z: https://premium.wpmudev.org/blog/wordpress-dictionary/
  2. Antes de codear algo en WP, busca un plugin o tema, hay miles de ellos, si no sabes cual usar, pregunta.
  3. Si vas a codear o modificar templates, aprende "Child Themes" y la jerarquia de ejecución https://developer.wordpress.org/themes/basics/template-hierarchy/
  4. Si vas a codear plugins o templates para WP, revisa la API, hay cientos de funciones ya hechas https://codex.wordpress.org/WordPress_APIs por ejemplo, ya WP tiene un sistema de manejo de llamadas AJAX built in ( https://codex.wordpress.org/AJAX_in_Plugins) y un ejemplo más didáctico del uso de AJAX dentro de WP lo puedes encontrar por acá https://premium.wpmudev.org/blog/using-ajax-with-wordpress/
  5. WP parece sencillo y en su estado puro no parece la gran cosa pero puede ser extendido fácilmente, aprende de "custom posts" y "custom fields" para personalizarlo ( advanced custom fields es un
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@fforbeck
fforbeck / move_messages.sh
Created February 25, 2016 14:10
RabbitMQ - Shovel Plugin: Move messages from one queue to another via command line
# The command deletes the parameter after all messages are moved origin to target queue
rabbitmqctl set_parameter -p <vhost> shovel "<origin.queue.name>" '{"src-uri":"amqp://<user>:<pwd>@/<vhost_name>","src-queue":"<origin.queue.name>","dest-uri":"amqp://<user>:<pwd>@/<vhost_name>","dest-exchange":"<target.queue.name>","prefetch-count":1,"reconnect-delay":5,"add-forward-headers":false,"ack-mode":"on-confirm","delete-after":"queue-length"}'
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@grenade
grenade / update_firefox_developer_edition.sh
Last active February 5, 2022 11:04 — forked from simonewebdesign/install_sublime_text.sh
this script is based on another for Sublime Text (http://www.simonewebdesign.it/install-sublime-text-3-on-linux/). It will handle updates (detects the latest developer or nightly edition) and locale (using your $LANG environment variable) (only tested on a 64 bit, fedora system, feedback welcome).
#!/bin/sh
# Firefox Developer Edition install
# No need to download this script, just run it on your terminal:
# $ curl -L git.io/firefoxdev | sh
# When you need to update Firefox Developer Edition, run this script again.
START_CMD="firefox-dev"
INSTALLATION_DIR="/opt/${START_CMD}"