This file contains hidden or 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
WITH OrderedMessages AS ( | |
SELECT *, | |
LAG(`from`) OVER (ORDER BY `timestamp`) AS PrevFrom | |
FROM Conversations | |
), | |
AlternatingMessages AS ( | |
SELECT `timestamp`, `from`, `message` | |
FROM OrderedMessages | |
WHERE NOT (`from` = 'chatbot' AND PrevFrom = 'chatbot') | |
), |
This file contains hidden or 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 re | |
# necesitamos un diccionaro con los | |
# posibles country codes que no son estándar | |
# pueden venir de 1-3 dígitos | |
# y puede haber ambigüedad (eg. 50 vs 501) | |
# algunos comparten código de país | |
# (eg. estados unidos y puerto rico pueden ser +1) | |
# si se desea distinguir entre países que | |
# comparten código, hay que ver también el código |
This file contains hidden or 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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
// Add custom actions and keybindings to this array. | |
// To unbind a key combination from your defaults.json, set the command to "unbound". | |
// To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings | |
"actions": | |
[ | |
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json. | |
// These two lines additionally bind them to Ctrl+C and Ctrl+V. | |
// To learn more about selection, visit https://aka.ms/terminal-selection |
This file contains hidden or 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
library(readr) # para leer fechas en español | |
library(dplyr) # para usar mutate y pipes | |
# asumiendo un data.frame cualquiera con una columna "x2" con | |
# los nombres de los meses, sin día y sin año | |
df = data.frame( | |
x1 = c('1', '2', '3'), | |
x2 = c("ENERO", "DICIEMBRE", "AGOSTO") | |
) |
This file contains hidden or 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
select * | |
from ( | |
select * | |
from TABLE | |
order by SORT_COLUMN desc | |
) temp | |
where rownum <= N_ROWS | |
order by SORT_COLUMN asc; |
This file contains hidden or 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
# Requierements | |
sudo apt install util-linux bash procps hostapd iproute2 iw haveged net-tools dnsmasq iptables | |
cd /opt && git clone https://github.com/oblique/create_ap | |
cd create_ap && sudo make install | |
# Get wireless adapter ID | |
iwconfig | |
# Create temporary WLAN (closing this process will remove WLAN) | |
sudo create_ap -n wlp0s20f3 |
This file contains hidden or 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
const int pot = A0; // potentiometer | |
const int led = D8; | |
int potValue = 0; | |
long timestamp; | |
void setup () { | |
Serial.begin(9600); | |
Serial.println("Initializing..."); | |
timestamp = millis(); |
This file contains hidden or 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
create temp table user_info as | |
select A.*, B.sends_to_role | |
from users as A | |
left join role_plans as B on A.role_id = B.role_id | |
where 1 = 1 | |
and (A.id = '{user_id}' or A.sap_id = '{user_id}') | |
and A.doc_id = '{doc_id}' | |
and A.is_active = true; |
This file contains hidden or 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
# ... | |
export PATH=~/.npm-global/bin:$PATH | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/oracle/instantclient_11_2 | |
export PATH=$LD_LIBRARY_PATH:$PATH | |
export TNS_ADMIN=/opt/oracle | |
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 | |
export ANDROID_HOME="/usr/lib/android/sdk/" | |
export PATH="${PATH}:${ANDROID_HOME}tools/:${ANDROID_HOME}platform-tools/" | |
export PATH=/usr/local/cuda-10.1/bin:/usr/local/cuda-10.1/NsightCompute-2019.1${PATH:+:${PATH}} |
This file contains hidden or 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
module.exports = { | |
root: true, | |
env: { | |
browser: true, | |
node: true, | |
commonjs: true, | |
es6: true, | |
}, | |
parserOptions: { | |
parser: "babel-eslint", |
NewerOlder