Skip to content

Instantly share code, notes, and snippets.

// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
};
@DerexScript
DerexScript / mic-loopback.sh
Created November 29, 2021 06:09 — forked from iamc/mic-loopback.sh
script to enable/disable pulseaudio loopback module in order to get eg. mic feedback
#!/bin/bash
#
# Loads / unloads pulseaudio loopback module in order to eg. be redirect
# mic input to headphones.
#
# Usage: mic-loopback [on|off]
#
if [ $# -ne 1 ]; then
echo "Usage: $0 [on|off]"
void function() {//closure
var global = this
, _initKeyboardEvent_type = (function( e ) {
try {
e.initKeyboardEvent(
"keyup" // in DOMString typeArg
, false // in boolean canBubbleArg
, false // in boolean cancelableArg
, global // in views::AbstractView viewArg
@DerexScript
DerexScript / Laravel_Global_Installer.sh
Created July 21, 2021 00:11 — forked from arvinesmaeily/Laravel_Global_Installer.sh
Laravel Global Installer (Including PHP, Composer and PHP extensions)
#!/bin/sh
sudo apt-get update && apt-get upgrade
sudo apt-get install php
sudo apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
@DerexScript
DerexScript / curl_jsoncpp_example.cpp
Created March 30, 2020 10:16 — forked from connormanning/curl_jsoncpp_example.cpp
Curl HTTP GET and JsonCpp parsing - basic functionality
#include <cstdint>
#include <iostream>
#include <memory>
#include <string>
#include <curl/curl.h>
#include <json/json.h>
namespace
{
#include <windows.h>
#include <stdio.h>
#define INITIAL_BUFFER (MAX_PATH * 5)
char *listAllDirectories(char *path) {
WIN32_FIND_DATA data;
size_t bufferSize = INITIAL_BUFFER;
char *directories = (char*)calloc(1, bufferSize);
char *buffer = directories;
@DerexScript
DerexScript / recompile-and-run.sh
Created January 10, 2020 17:14 — forked from PuKoren/recompile-and-run.sh
Recompile APK + Sign with apktool
# You must first install apktool (https://github.com/iBotPeaches/Apktool) and android SDK
# and decompile apk using it
# apktool d -rf my-app.apk
# then generate a key for sign in:
# keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
rm signed-app.apk
apktool b -f -d com.myapp
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore com.myapp/dist/com.myapp.apk alias_name
zipalign -v 4 com.myapp/dist/com.myapp.apk signed-app.apk
@DerexScript
DerexScript / officeActivator.bat
Created December 15, 2019 19:30
Activate Microsoft Office 2019
@echo off
title Activate Microsoft Office 2019 !
cls
echo ============================================================================
echo #Project: Activating Microsoft software products
echo ============================================================================
echo.
echo #Supported products:
echo - Microsoft Office Standard 2019
echo - Microsoft Office Professional Plus 2019
@DerexScript
DerexScript / activator.bat
Created December 15, 2019 19:29
Activate Windows 10
@echo off
title Activate Windows 10 !
cls
echo ============================================================================
echo #Project: Activating Microsoft software products
echo ============================================================================
echo.
echo #Supported products:
echo - Windows 10 Home
echo - Windows 10 Home N
@DerexScript
DerexScript / ClearInputBuff.cpp
Created June 12, 2019 03:03 — forked from manadream/ClearInputBuff.cpp
Clearing input buffer in C++ completely
#include <iostream>
#include <limits>
using namespace std;
int main(){
char var[10];
bool valid = false;
while(!valid){
cout << "Enter a string 9 characters long: ";