Skip to content

Instantly share code, notes, and snippets.

View eyvoro's full-sized avatar
🏠
Working from home

eyvoro

🏠
Working from home
View GitHub Profile
@eyvoro
eyvoro / bash_shortcuts.txt
Created March 1, 2013 11:47
BASH shortcuts
Ctrl-a Move to the start of the line.
Ctrl-e Move to the end of the line.
Ctrl-b Move back one character.
Alt-b Move back one word.
Ctrl-f Move forward one character.
Alt-f Move forward one word.
Ctrl-] x Where x is any character, moves the cursor forward to the next occurance of x.
Alt-Ctrl-] x Where x is any character, moves the cursor backwards to the previous occurance of x.
Ctrl-u Delete from the cursor to the beginning of the line.
Ctrl-k Delete from the cursor to the end of the line.
from random import randrange
from twisted.internet.defer import DeferredQueue
from twisted.internet.task import deferLater, cooperate
from twisted.internet import reactor
def async(n):
print 'Starting job', n
d = deferLater(reactor, n, lambda: None)
@eyvoro
eyvoro / nginx-rewrites-yoast-wordpress-seo
Created September 14, 2016 09:41 — forked from SimpleHomelab/nginx-rewrites-yoast-wordpress-seo
Nginx rewrites for Yoast's WordPress SEO plugin. These rewrites go into the Nginx host file between the server blocks.
# This rewrite redirects sitemap.xml to sitemap_index.xml, which is what Yoast's WordPress SEO plugin generates.
rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent;
# This rewrite ensures that the styles are available for styling the generated sitemap.
rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 last;
# These rewrites rule are generated by Yoast's plugin for Nginx webserver
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
The List of Country Codes
Country Code
Afghanistan AF
Aland Islands AX
Albania AL
Algeria DZ
American Samoa AS
Andorra AD
Angola AO
@eyvoro
eyvoro / minify.go
Created January 28, 2017 23:23 — forked from jeevatkm/minify.go
Minify Filter - Revel Framework - Go Lang. Article: http://myjeeva.com/minify-filter-revel-framework-go-lang.html
//
// The MIT License (MIT)
//
// Copyright (c) 2016 Jeevanandam M. ([email protected])
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@eyvoro
eyvoro / wp-tools.php
Created January 25, 2018 09:40
wp-tools.php
<?php
if ( !defined('SAVEQUERIES') && isset($_GET['debug']) && $_GET['debug'] == 'sql' )
define('SAVEQUERIES', true);
if ( !function_exists('dump') ) :
/**
* dump()
*
* @param mixed $in
* @return mixed $in
**/
openocd_rp2040.exe -f interface/jlink.cfg -f target/rp2040.cfg -c "program C:\\Projects\\pico\\.pio\\build\\raspberry-pi-pico\\APPLICATION.elf verify reset exit"
@eyvoro
eyvoro / AVR Sleep
Created April 6, 2021 20:17 — forked from JChristensen/AVR Sleep
AVR microcontroller sleep demonstrations
Simple demonstrations of putting AVR microcontrollers to sleep in power-down mode,
which results in minimum current. Coded with Arduino IDE version 1.0.4 (and with
the Arduino-Tiny core for the ATtiny MCUs, http://code.google.com/p/arduino-tiny/)
For ATmega328P, ~0.1µA.
For ATtinyX5 revisions that implement software BOD disable, ~0.1µA,
for ATtinyX5 revisions that don't, ~20µA.
@eyvoro
eyvoro / sleep.ino
Created April 7, 2021 10:34 — forked from stojg/sleep.ino
Arduino sleep example
#include "Arduino.h"
#include <avr/sleep.h>
#include <avr/power.h>
#include <avr/wdt.h>
// Blink Before sleeping
#define LED_PIN (13)
// This variable is made volatile because it is changed inside
// an interrupt function
@eyvoro
eyvoro / main.go
Created June 5, 2021 14:23 — forked from buroz/main.go
Golang SOAP Request Example
package main
import (
"bytes"
"crypto/tls"
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
"strings"