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
const fs = require('fs'); | |
const mysql = require('mysql'); | |
// MySQL database connection configuration | |
const connection = mysql.createConnection({ | |
host: '<host>', | |
user: '<user>', | |
password: '<password>', | |
database: '<database>' | |
}); |
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
const ethers = require('ethers'); | |
const mnemonic = await ethers.utils.HDNode.entropyToMnemonic(ethers.utils.randomBytes(16)); |
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
#!/bin/bash | |
set -B | |
for i in {1..1000}; do | |
curl $path/$i.png > $i.png # replcae $path with yours | |
done |
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
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
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
// Default URL for triggering event grid function in the local environment. | |
// http://localhost:7071/runtime/webhooks/EventGrid?functionName={functionname} | |
using System; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Host; | |
using Microsoft.Azure.EventGrid.Models; | |
using Microsoft.Azure.WebJobs.Extensions.EventGrid; | |
using Microsoft.Extensions.Logging; | |
using Newtonsoft.Json.Linq; | |
using System.IO; |
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
@RequestMapping(path = "/scriptingonly/list", method = RequestMethod.GET) | |
public DataTable<Script> getScriptingOnlyList(@PathVariable("gameCode") String gameCode, @PathVariable("deviceOs") String deviceOs, @Valid DataTableParameter parameters, @RequestParam(name="search", required=false) String searchText) { | |
LOG.debug("GameCode:{} DeviceOs:{} DataTableParameter:{} SearchText:{}", gameCode, deviceOs, parameters, searchText); | |
DataTable<Script> scriptDataTable = scriptService.getScriptDataTable(gameCode, deviceOs, parameters, searchText); | |
return scriptDataTable; | |
} |
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.Runtime.InteropServices; | |
using System.Threading; | |
namespace WindowsIdleTime | |
{ | |
class Program | |
{ | |
[DllImport("user32.dll", SetLastError = true)] | |
static extern uint SendInput(uint nInputs, ref INPUT pInputs, int cbSize); |
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 class CustomProxyServlet extends ProxyServlet { | |
private final Map<String, FilterableHost> filterMap; | |
public CustomProxyServlet() { | |
this.filterMap = new HashMap<>(); | |
} | |
public CustomProxyServlet referHostFilterByUrl(String fromUrl, String toUrl) { | |
if(filterMap.containsKey(fromUrl)) { |
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.Security.Cryptography; | |
using System.Text; | |
namespace AesExample | |
{ | |
class Program | |
{ | |
private const string ORIGINAL = "this is some data to encrypt"; | |
private const string SAMPLE_KEY = "gCjK+DZ/GCYbKIGiAt1qCA=="; | |
private const string SAMPLE_IV = "47l5QsSe1POo31adQ/u7nQ=="; |
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
#include <ctime> | |
#include <stdio.h> | |
#include <iostream> | |
using namespace std; | |
bool is_leap_year(int year); | |
int get_wday_january_first(int yday, int wday); | |
int main() |
NewerOlder