This file contains hidden or 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 hidden or 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
// | |
// UIImageViewExtention.swift | |
// MealSpecials | |
// | |
// Created by Aruna on 8/9/15. | |
// Copyright (c) 2015 com.mealspecials. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains hidden or 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
[DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)] | |
static extern IntPtr GetParent(IntPtr hWnd); | |
[DllImport("user32", CharSet = CharSet.Auto, SetLastError = true)] | |
static extern int GetWindowText(IntPtr hWnd, [Out, MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpString, int nMaxCount); | |
public static String GetWindowTitle(IntPtr handle) { | |
IntPtr windowParent = IntPtr.Zero; | |
while (handle != IntPtr.Zero) { |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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); | |
} |
OlderNewer