Skip to content

Instantly share code, notes, and snippets.

View amenpunk's full-sized avatar
🌌

Edgar Rolando Cosajay Campos amenpunk

🌌
View GitHub Profile
function loadJsonAsObjectfromFile() {
var fs = require('fs');
var jsonData = fs.readFileSync('data.json');
// var jsonData = fs.readFileSync('inter.json');
return JSON.parse(jsonData);
}
function writeJsonToFile(jsonData) {
var fs = require('fs');
fs.writeFileSync('out.json', JSON.stringify(jsonData, null, 2));
version: "2.1"
services:
busybox1:
image: busybox
command: ping 172.17.255.255 -s 65500
network_mode: bridge
busybox2:
image: busybox
command: ping 172.17.255.255 -s 65500
configure php xdebug on nvim
php.ini
zend_extension=xdebug
xdebug.mode = debug
xdebug.start_with_request=yes
xdebug.client_host=host.docker.internal
xdebug.client_port=9000
id nombre
1 Alta Verapaz
2 Baja Verapaz
3 Chimaltenango
4 Chiquimula
5 El Progreso
6 Escuintla
7 Guatemala
8 Huehuetenango
9 Izabal
id nombre
1 Acatempa
2 Acatenango
3 Agua Blanca
4 Aguacatan
5 Almolonga
6 Alotenango
7 Amatitlan
8 Antigua Guatemala
9 Asuncion Mita
@amenpunk
amenpunk / trace.log
Last active September 8, 2022 23:35
Root: ${Root}
Local: ${LocalEnvironment}
Environment: ${Environment}
ExceptionList: ${ExceptionList}
TRUNCATE table db2was.esb_logging IMMEDIATE
let body = {
"nombre" : "Lucas Joel",
"apelidos" : "Juarez Jocon",
"telefono" : "45435345",
"direccio": "4 calle zona 1",
"fechacumple": "2021-01-01",
"nit": "5345435",
"cui": "555555",
"email": "[email protected]",
"username": "[email protected]",
@amenpunk
amenpunk / rclone.service
Last active September 14, 2021 16:46
Simple rclone gdrive systemd service
# /etc/systemd/system/rclone.service
[Unit]
Description=Google Drive (rclone ming)
AssertPathIsDirectory=/home/ming/Drive
After=plexdrive.service
[Service]
Type=simple
ExecStart=/usr/bin/rclone mount \
--allow-other \
@amenpunk
amenpunk / jquery-redux-example.js
Created February 22, 2021 02:05 — forked from tzkmx/jquery-redux-example.js
Redux with jQuery simple example
// original from:https://codepen.io/mdd/pen/wGRqbw
// Reducer
const counter = (state = 0, actions) => {
switch (actions.type) {
case 'INCREMENT': return state + 1;
case 'DECREMENT': return state - 1;
default: return state
}
}
@amenpunk
amenpunk / respond_and_process.php
Created January 28, 2021 16:22 — forked from kfriend/respond_and_process.php
PHP: Send response and continue processing
<?php
// Buffer all upcoming output...
ob_start();
// Send your response.
echo "Testing response";
// Get the size of the output.
$size = ob_get_length();