Skip to content

Instantly share code, notes, and snippets.

Daniel danielyaa5

  • Los Angeles
Block or report user

Report or block danielyaa5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View scrapeSteem.js
const util = require('util');
const request = require('request-promise');
const cheerio = require('cheerio');
const imageDataURI = require('image-data-uri')
const _ = require('lodash');
function getImgUris(urls) {
return Promise.all(urls.map(imageDataURI.encodeFromURL));
}
View msgvalueissue.sol
uint private accept_payment;
function accept(string buyer_email) external payable {
accept_payment = msg.value;
buyer = msg.sender;
buyer_contact_information = buyer_email;
_setConversionRate();
_changeState(ContractStates.Accepting);
}
function cancelAccept() external onlyBuyer {
View increaseTime.js
testRpc.increaseTime = function(secondsToJump, cb) {
function send(method, params, callback) {
if (typeof params == "function") {
callback = params;
params = [];
}
provider.sendAsync({
jsonrpc: "2.0",
method: method,
View password-manager.js
'use strict';
const read = require('read')
const CryptoJS = require("crypto-js");
const handleReadErr = err => console.log(`Problem reading input.%n ${err}`);
const handleDecryptError = err => {
console.log(`Failed to decrypt text, probably the incorrect pwd.`);
if (err) console.log(err);
}
View password-manager.js
read({ prompt: 'Paste encrypted passwords file:'}, (err, encryptedText) => {
let decryptedText;
try {
decryptedText = decrypt(encryptedText, pwd);
} catch (e) {
return handleDecryptError(e);
} finally {
if (!decryptedText) return handleDecryptError();
}
View bijection.py
n = int(input())
f = map(int,raw_input().split())
print "YES" if len(f)==len(set(f)) else "NO"
View gist:108230c7dca42811cf9f6209a9864218
(load "functionParser.scm")
(load "environment.scm")
;(define call/cc call-with-current-continuation)
(define interpret
(lambda (filename)
(interpret-func-call 'main '() (interpret-global-stmt-list (parser filename) newenv))))
(define interpret-global-stmt-list
View connect.java
private void connectToUrl() {
System.out.println("Connecting to requested server");
String[] requestLine = requestHeaders.get(0).split(" ");
String uri = requestLine[1];
String method = requestLine[0];
String domain = uri.substring(7, uri.length());
int index = domain.indexOf("/");
String hostname = domain.substring(0, index);
String directory = domain.substring(index, domain.length());
You can’t perform that action at this time.