Skip to content

Instantly share code, notes, and snippets.

View Alynva's full-sized avatar
🤔
Thinking

Alisson Nunes Alynva

🤔
Thinking
View GitHub Profile
@si458
si458 / build.js
Last active December 28, 2023 10:18
build script for pkg with icon and metainfo
if (process.argv[2] == undefined) process.exit(0);
if (process.argv[2] == "") process.exit(0);
const { pkg_fetch_version, node_version, pkg_cache_path, icon, version, description, company, name, copyright, file } = require(`./${process.argv[2]}.json`);
const ResEdit = require('resedit');
const path = require("path");
const fs = require('fs');
const https = require('https');
function download(url, dest) {
return new Promise((resolve, reject) => {
fs.access(dest, fs.constants.F_OK, (err) => {
@at15four2020
at15four2020 / GParsers.gprog.md
Last active September 23, 2022 15:27
GProgrammer parsers

Parsers

This is a list of known packages parsers mainly to be used in G-Earth with the GProgrammer extension, but the code may be useful to understand the package structure and read it anywhere.

Return structure

Every parser may share some caracteritcs:

  • The parser is responsable to read the whole package, from the start to the end;
  • The return type is always an object;
@carry0987
carry0987 / RPi3-Auto-WiFi.md
Last active April 17, 2024 04:50
Raspberry Pi 3B+ Auto reconnect to wifi when lost connect

Auto reconnect to wifi when lost connection

Before you start, make sure ip command is available on your system. In modern Linux distributions, ip replaces older ifconfig command. If net-tools package (that includes ifconfig) is not installed and you prefer using it, you can install it via sudo apt-get install net-tools.

Create script file

Use touch /home/pi/wifi-reconnect.sh to create a shell script file, with the following content:

#!/bin/bash
@sgreben
sgreben / apk flags.md
Created April 13, 2018 13:09
apk flags

apk

apk-tools 2.8.2, compiled for x86_64.

usage: apk COMMAND [-h|--help] [-p|--root DIR] [-X|--repository REPO] [-q|--quiet] [-v|--verbose] [-i|--interactive] [-V|--version] [-f|--force]
           [--force-binary-stdout] [--force-broken-world] [--force-non-repository] [--force-old-apk] [--force-overwrite] [--force-refresh] [-U|--update-cache]
           [--progress] [--progress-fd FD] [--no-progress] [--purge] [--allow-untrusted] [--wait TIME] [--keys-dir KEYSDIR] [--repositories-file REPOFILE]
           [--no-network] [--no-cache] [--cache-dir CACHEDIR] [--arch ARCH] [--print-arch] [ARGS]...
@talk2MeGooseman
talk2MeGooseman / index.js
Last active November 16, 2022 15:24
Firebase Cloud Function 3rd Party Oauth Flow For The Web
const functions = require('firebase-functions');
var admin = require("firebase-admin");
const cookieParser = require('cookie-parser');
const crypto = require('crypto');
var serviceAccount = require("./service-account.json");
const APP_NAME = "twitch-playground";
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
@codediodeio
codediodeio / index.js
Created July 17, 2017 17:40
Algolia Firebase Cloud Functions - Update/Delete Items from Index
const functions = require('firebase-functions');
const admin = require("firebase-admin");
admin.initializeApp(functions.config().firebase);
const algoliasearch = require('algoliasearch');
const algolia = algoliasearch(functions.config().algolia.appid, functions.config().algolia.adminkey);
exports.updateIndex = functions.database.ref('/books/{bookId}').onWrite(event => {
@sp0oks
sp0oks / data_structures.h
Last active November 17, 2017 10:28
Abstract data types library in C++
/* My personal project of a library that includes different types of template container structures.
*
* A work in progress with the objective of implementing the most useful data structures in C++ for later reuse in real projects and also studying data structures themselves.
*
* Implemented and tested structures until latest revision:
* Node
* Stack
* Queue
* List
* KeyNode
@jagrosh
jagrosh / WebhookTutorial.md
Last active December 4, 2023 20:28
Simple Webhook Tutorial (Twitter -> Discord)

Simple Webhook Tutorial

In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel

Step 1 - Register on Zapier

  1. Go to https://zapier.com/ and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send Tweets
@dahjelle
dahjelle / pre-commit.sh
Created July 13, 2016 16:48
Pre-commit hook for eslint, linting *only* staged changes.
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint."
exit 1 # exit with failure status
fi
done
@noelboss
noelboss / git-deployment.md
Last active April 24, 2024 03:17
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.