This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Podemos separar la definición de las constantes | |
// en un archivo .H a parte e incluir después | |
#define MODE_SHIT 0 | |
#define MODE_STORAGE 1 | |
#define KEYDOWN_THRESHOLD 1500 | |
#define LCD_DISPLAY_DELAY 1000 | |
void display(int x, int y, char *string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
import os | |
handler = open("index.html", "r") | |
data = handler.readlines() | |
expression = re.compile(r'".*/(pc-engine-fan-.*)/.*"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
from html.parser import HTMLParser | |
class MyHTMLParser(HTMLParser): | |
detected_season = None | |
detected_chapter = None | |
current_season = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Disclaimer: it's your funeral | |
APP_PROCESS_NAME="Pritunl" | |
DAEMON_PATHS=( "/Library/LaunchAgents/com.pritunl.client.plist" \ | |
"/Library/LaunchDaemons/com.pritunl.service.plist" \ | |
"/Library/LaunchDaemons/net.sf.tuntaposx.tap.plist" \ | |
"/Library/LaunchDaemons/net.sf.tuntaposx.tun.plist" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import requests | |
from requests_aws4auth import AWS4Auth | |
# Origin: host = 'https://my-elasticsearch-endpoint.com/' | |
# Destination: | |
host = 'https://my-elasticsearch-enpoint-destination.com/' | |
region = 'eu-west-1' # For example, us-west-1 | |
service = 'es' | |
credentials = boto3.Session().get_credentials() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is just the JavaScript side, so an HTML must be created with a canvas element. | |
* Originally published by @NoahYamamoto | |
*/ | |
function StartMouseTrail() { | |
const canvas = document.getElementById("canvas"); | |
const ctx = canvas.getContext("2d"); | |
// Get proper height and width for canvas, then set resize handler. | |
canvas.width = window.innerWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Originally created by @jake_albaugh (Twitter) | |
* UTF8 characters starting from "\u2581" | |
*/ | |
const l = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"]; | |
const x = new AudioContext(); | |
const a = x.createAnalyser(); | |
a.fftSize = 32; | |
const d = new Uint8Array(16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The idea of this piece of code is to demonstrate how asyncio | |
works so you can understand the benefits of using it in your | |
IO-demansind apps. | |
The application creates a defined number of workers that will | |
generate a request to a website for a randomly-generated numbers | |
and will return the sum. | |
Note that when running the code workers will be created immediately, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Place this file in ~/.mozilla/firefox/<profile folder>/chrome/userChrome.css */ | |
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); | |
#navigator-toolbox[inFullscreen] toolbar:not([collapsed="true"]) { | |
visibility:visible!important; | |
} |
NewerOlder