Skip to content

Instantly share code, notes, and snippets.

View nautical's full-sized avatar
👨‍💻
Working from home

Piyush nautical

👨‍💻
Working from home
View GitHub Profile
pragma solidity ^0.5.0;
contract Token {
mapping (address => uint) tokenBalance;
mapping (address => uint) etherBalance;
uint currentRate;
constructor() public {
currentRate = 2;
const { promises: fs } = require('fs');
const path = require('path');
// find plugins in a directory, matching a pattern, ignoring registered plugins
function findPlugins(dir, pattern, registered) {
let segments = pattern.split('/');
let regexp = new RegExp(`^${segments.pop().replace('*', '.*')}`);
dir = path.join(dir, ...segments);
return fs.readdir(dir).then(f => f.reduce((plugins, dirname) => {

Keybase proof

I hereby claim:

To claim this, I am signing this object:

const headers = {
headers: {
"content-type": "application/json"
}
};
const accel = {
createWallet: async (endPoint, auth) => {
try {
const makeCreateWalletRequest = await axios.post(
caffeine = hs.menubar.new()
function setCaffeineDisplay(state)
if state then
caffeine:setTitle("AWAKE")
else
caffeine:setTitle("SLEEPY")
end
end
function showNotification()
@nautical
nautical / styles.diff
Last active September 13, 2018 00:59
--- app_extract/styles/main.css 2018-09-13 06:25:53.000000000 +0530
+++ app_extract.backup/styles/main.css 2018-09-13 05:50:13.000000000 +0530
@@ -5838,21 +5838,21 @@
color: rgba(255, 255, 255, 0.3); }
.mdi-rotate-45 {
- /*
- // Not included in production
- &.mdi-flip-h:before {
- -webkit-transform: scaleX(-1) rotate(45deg);
@nautical
nautical / AES.html
Last active February 8, 2018 20:24
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="enctest"></div>
</body>
<script type="text/javascript" src="//cdn.rawgit.com/ricmoo/aes-js/e27b99df/index.js"></script>
<script type="text/javascript">
<!DOCTYPE html>
<html>
<head>
<title>Hiding Text</title>
</head>
<body>
<input type="text" placeholder="Normal Text" id="textval">
<input type="text" placeholder="Key" id="key">
<button id="convert" onclick="convert();">Convert</button>
<br>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Conversion</title>
<script type="text/javascript">
function convertor() {
var hindi = new Array(
"ñ", "Q+Z", "sas", "aa", ")Z", "ZZ", "‘", "’", "“", "”",
@nautical
nautical / gist:9859452
Created March 29, 2014 18:21
EmbeddedSolrExample.java
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.core.CoreContainer;
import org.apache.solr.common.SolrInputDocument;
public class EmbeddedSolrExample{