Skip to content

Instantly share code, notes, and snippets.

View clouedoc's full-sized avatar
🌴
Doing absolutely nothing

Camille Louédoc-Eyriès clouedoc

🌴
Doing absolutely nothing
View GitHub Profile
@alexklibisz
alexklibisz / 0-firefly-grafana-example.md
Last active October 30, 2022 12:12
Firefly + Grafana Example
crasher = someBool => {
let divZero = Math.min(Infinity ? [] : Infinity, -0) / 0;
if (someBool) divZero = -0;
return divZero ? 1 : 0
};
crasher(false);
for (let i = 0; i < 0x10000; ++i) crasher(false);
@LeZuse
LeZuse / 00_README.md
Last active April 22, 2024 15:06
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@le-dawg
le-dawg / awsmining.md
Created December 29, 2020 15:20
XMR Mining AWS ... here is how to do it securely

So you want to mine in AWS without getting caught

tl;dr: AWS mining is against TOC so even if you have credits you will be invoiced and your credits burned. Watch out. These methods only help mitigate or lower the risk of discovery. Share responsibly.

Problem

AWS is firewalled af on top of the policy mentioned in tl;dr. A good way is to use a mining proxy with TLS. Even better would be a point-to-point VPN. Using VPN directly is also a good solution - but services that let you configure that you only want one certain port to run via VPN and not the SSH connection that is your lifeline are costly. This document sketches a few solutions, provides some links, and documents one particular approach. And remember, methods of detection will soon encompass deep learning: https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9178288

@andelf
andelf / trc20.js
Created April 20, 2020 07:12
Get TRC20 balance and transfer USDT tokens
const TronWeb = require('tronweb');
const HttpProvider = TronWeb.providers.HttpProvider;
const fullNode = new HttpProvider("https://api.trongrid.io");
// const fullNode = new HttpProvider("http://192.168.1.162:8090");
const solidityNode = new HttpProvider("https://api.trongrid.io");
const eventServer = new HttpProvider("https://api.trongrid.io");
const privateKey = "3481E79956D4BD95F358AC96D151C976392FC4E3FC132F78A847906DE588C145";
const tronWeb = new TronWeb(fullNode, solidityNode, eventServer, privateKey);
@loilo
loilo / idb-backup-and-restore.md
Last active April 29, 2024 06:40
Back up and restore an IndexedDB database

Back up and restore an IndexedDB database

This gist is an ES module which provides functions to import and export data from an IndexedDB database as JSON. It's based on Justin Emery's indexeddb-export-import package, but applies some adjustments that reflect better on the current browser landscape (i.e. better developer ergonomics but no support for Internet Explorer).

Usage

For each of the provided functionalities, you need a connected IDBDatabase instance.

Export Data

import { idb } from 'some-database'
@aslushnikov
aslushnikov / networkinformation.js
Created June 3, 2019 03:48
Using Puppeteer to emulate Network Information API
const puppeteer = require('puppeteeer');
const networkConditions = {
'2g': {
downloadThroughput: 500 * 1024 / 8 * .8,
uploadThroughput: 500 * 1024 / 8 * .8,
latency: 400 * 5,
offline: false,
},
'3g': {
@edco
edco / mc-server.yaml
Created March 14, 2018 02:28
Create a Minecraft server on Google Cloud Platform in moments. Running this script amounts to accepting the Minecraft EULA. Based on https://cloud.google.com/solutions/gaming/minecraft-server but without the dedicated storage and backups.
resources:
- type: compute.v1.address
name: mcs-ip
properties:
region: australia-southeast1
- type: compute.v1.instance
name: mc-server
properties:
zone: australia-southeast1-c
machineType: zones/australia-southeast1-c/machineTypes/n1-standard-1
@Xetera
Xetera / First Discord Command
Created November 4, 2017 10:57
One of the first "working" pieces of code I wrote in python for discord ft. global variables
async def cmd_weather(self, channel, author):
import json
from array import array
import requests
from collections import OrderedDict
from pprint import pprint
api_key = "&APPID=507e30d896f751513350c41899382d89"
city_name_url = "http://api.openweathermap.org/data/2.5/weather?q="
units = "&units=metric"
global general_info
@barneycarroll
barneycarroll / unfuckReact.js
Last active September 2, 2022 14:37
React components are so fucking stupid, it's unbelievable. 3 months with this library version 15 and the glaring stupidity of the API just keeps coming in waves. Fixing some of this stuff – just for the sake of internal consistency – would have been so simple. The number of hoops you're required to jump through for trivial shit. Ugh.
const mounted = new WeakSet()
export default (component, displayName = component.displayName || component.name || 'React.Component') => {
const host = {
[displayName] : class extends React.Component {
constructor(){
this.state = {}
component.apply(this, arguments)
}