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
Do | |
Msgbox "This is a simple infinite loop" | |
Loop |
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
const ua = require("universal-analytics"); | |
const request = require("request-promise"); | |
const { https } = require("firebase-functions"); | |
function getUserID (obj) { | |
if (!obj.source) { | |
return "dialogflow"; | |
} else { | |
switch (obj.source) { | |
case "twilio": |
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
{ | |
"$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 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 pandas as pd | |
import numpy as np | |
def drop_outliers(df, field_name): | |
distance = 1.5 * (np.nanpercentile(df[field_name], 75) - np.nanpercentile(df[field_name], 25)) | |
df.drop(df[df[field_name] > distance + np.nanpercentile(df[field_name], 75)].index, inplace=True) | |
df.drop(df[df[field_name] < np.nanpercentile(df[field_name], 25) - distance].index, inplace=True) | |
if __name__ == "__main__": | |
# assuming df exists and contains numeric variables |
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
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 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
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |
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
select * | |
from ( | |
select * | |
from TABLE | |
order by SORT_COLUMN desc | |
) temp | |
where rownum <= N_ROWS | |
order by SORT_COLUMN asc; |
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
# 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 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 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; |
NewerOlder