Skip to content

Instantly share code, notes, and snippets.

View stinkymonkeyph's full-sized avatar
🙊
Disrupting something

Nelmin Jay Magan Anoc stinkymonkeyph

🙊
Disrupting something
View GitHub Profile
@stinkymonkeyph
stinkymonkeyph / ShellExecutionTokio
Created December 10, 2023 03:08
Async shell command execution using tokio runtime
use std::process::Stdio;
use tokio::{process::{Child, Command as TokioCommand, ChildStdout, ChildStderr}, io::BufReader};
use crate::errors::provisioner_errors::ProvisionerError;
pub struct Shell {
pub command: String
}
impl Shell {
pub async fn execute(&self) -> Result<(), ProvisionerError> {
"use client";
import { Fragment } from 'react'
import { Menu, Popover, Transition } from '@headlessui/react'
import {
ChatBubbleLeftEllipsisIcon,
CodeBracketIcon,
EllipsisVerticalIcon,
EyeIcon,
FlagIcon,
import React from 'react';
import {
List,
CellMeasurer,
CellMeasurerCache,
InfiniteLoader,
AutoSizer
} from 'react-virtualized';
import Item from './Item';
@stinkymonkeyph
stinkymonkeyph / mysql-docker.sh
Created May 13, 2020 15:31 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
location ^~ /api {
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://localhost:6969;
}
@stinkymonkeyph
stinkymonkeyph / AppBaseActivity.java
Created April 30, 2018 05:06
Android: Easiest way to reuse a common Navigation drawer among a group of activities.
/*
* This is a simple and easy approach to reuse the same
* navigation drawer on your other activities. Just create
* a base layout that conains a DrawerLayout, the
* navigation drawer and a FrameLayout to hold your
* content view. All you have to do is to extend your
* activities from this class to set that navigation
* drawer. Happy hacking :)
* P.S: You don't need to declare this Activity in the
* AndroidManifest.xml. This is just a base class.
<!DOCTYPE html>
<html>
<head>
<title>My Location</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
#map {
height: 616px;
margin-top: 5px;
@stinkymonkeyph
stinkymonkeyph / package.json
Created July 13, 2017 00:39
react-redux app template older version
// react-redux app template
// based on create-react-app cli
// change { name }
{
"name": "",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^15.6.1",
@stinkymonkeyph
stinkymonkeyph / webpack.config.js
Last active July 10, 2017 17:14 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
//public/asset/js
//client.js
//client.min.js
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname + "/public",
devtool: debug ? "inline-sourcemap" : null,
@stinkymonkeyph
stinkymonkeyph / package.json
Created July 10, 2017 17:10
package.json for react applications
{
"name": "moduleloader",
"version": "1.0.0",
"description": "fucking module loading system",
"main": "webpack.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "none",
"license": "ISC",