This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppsUtil | |
{ | |
public static List<InstalledApp> GetInstalledApps() | |
{ | |
List<InstalledApp> map = new List<InstalledApp>(); | |
string InstallerKey = @"Installer\Products"; | |
using (RegistryKey installkeys = Registry.ClassesRoot.OpenSubKey(InstallerKey)) | |
{ | |
foreach (string name in installkeys.GetSubKeyNames()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Net; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace CachedImage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static final String allChar = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
public static final String letterChar = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
public static final String numberChar = "0123456789"; | |
public static String generateString(int length) | |
{ | |
StringBuffer sb = new StringBuffer(); | |
SecureRandom random = new SecureRandom(); | |
for (int i = 0; i < length; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/letsencrypt/letsencrypt | |
cd letsencrypt | |
sudo ./letsencrypt-auto --nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OTA Update using ESPhttpUpdate | |
/* ESPhttpUpdate.update("192.168.0.2", 80, "/arduino.bin"); | |
t_httpUpdate_return ret = ESPhttpUpdate.update("192.168.0.2", 80, "/esp/update/arduino", "optional current version string here"); | |
switch(ret) { | |
case HTTP_UPDATE_FAILED: | |
Serial.println("[update] Update failed."); | |
break; | |
case HTTP_UPDATE_NO_UPDATES: | |
Serial.println("[update] Update no Update."); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String to uint8_t pointer | |
(uint8_t *)content.c_str() | |
char buf[chunkSize]; | |
file.read((uint8_t *)buf, chunkSize-1); | |
String(buf); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//How to to append a char array in arduino | |
char* p = (char*)malloc(sizeof(char)*12); | |
strcpy(p,"hello world"); | |
cout << p << "\r\n"; | |
p = (char*)realloc(p, sizeof(char)*24); | |
strcat(p," from Nish"); | |
cout << p << "\r\n"; | |
free(p); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern "C" { | |
enum sleep_type { | |
NONE_SLEEP_T = 0, | |
LIGHT_SLEEP_T, | |
MODEM_SLEEP_T | |
}; | |
bool wifi_set_sleep_type(enum sleep_type type); | |
void system_set_os_print(uint8 onoff); | |
void ets_install_putc1(void* routine); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require("request"); | |
var forecast = require('nostradamus'); | |
var stockQuotes = []; var nostroData = []; var predictions = []; | |
var alpha = 0.5; var beta = 0.4; var gamma = 0.6; var period = 5; var m = 2; | |
var url = "http://www.google.com/finance/getprices?i=900&p=5d&f=d,o,h,l,c,v&df=cpct&q=(ticker)"; | |
url = url.replace('(ticker)', 'AAPL'); | |
request({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Scan coinmarketcap and find good coins to buy | |
const CoinMarketCap = require('coinmarketcap-api') | |
const client = new CoinMarketCap() | |
client.getTicker({limit: 1000}).then( pairs => { | |
let filteredResult = pairs.filter(function(key) { | |
return (key.available_supply < 1500000); | |
}); |
OlderNewer