Skip to content

Instantly share code, notes, and snippets.

View ajays97's full-sized avatar
🌎
Ethereum FTW! Period.

Ajay Srinivas ajays97

🌎
Ethereum FTW! Period.
View GitHub Profile
@ajays97
ajays97 / DAOLaunchPad.sol
Created December 5, 2022 16:01
DAO LaunchPad Solidity 0.8.0
pragma solidity ^0.8.0;
contract DAOLaunchpad {
// the name of the launchpad
string public name;
// the address of the owner of the launchpad
address public owner;
// the mapping of members of the launchpad
@christopher4lis
christopher4lis / restrict-route-access-middleware.js
Created June 22, 2017 23:07
Used to restrict access to particular pages in combination with Passport.js
function authenticationMiddleware () {
return (req, res, next) => {
console.log(`req.session.passport.user: ${JSON.stringify(req.session.passport)}`);
if (req.isAuthenticated()) return next();
res.redirect('/login')
}
}
@hyb175
hyb175 / realmMock.js
Last active August 13, 2023 17:41
Realm Mock for jest
// https://github.com/realm/realm-js/issues/370#issuecomment-270849466
export default class Realm {
constructor(params) {
this.schema = {};
this.callbackList = [];
this.data = {};
this.schemaCallbackList = {};
params.schema.forEach((schema) => {
this.data[schema.name] = {};
});
@erogol
erogol / crawle_google.py
Created September 22, 2013 10:57
scrap google images given the target query
#!/usr/bin/env python
'''
Query on GoogleImageSearch and install resulted images by scraping.
To use this script install mechanize and BeautifulSoup packages as
easy_install mechanize
easy_install Beautiful