Skip to content

Instantly share code, notes, and snippets.

View niksmac's full-sized avatar
🇮🇳
🧜 Merperson

Nikhil M niksmac

🇮🇳
🧜 Merperson
View GitHub Profile
@niksmac
niksmac / tiffdump.py
Created July 8, 2023 06:24 — forked from pebbie/tiffdump.py
hopefully generic TIFF file format extraction tool (GeoTIFF, NEF, ARW)
"""
\description TIFF file format dump
\author paryan
"""
from __future__ import print_function
import argparse
from struct import *
import os
import os.path as path
@niksmac
niksmac / Donation.sol
Created June 17, 2017 06:41 — forked from fabdarice/Donation.sol
Relay contract that contains only one state variable 'user_amounts' - Link first to Donation contract, then update to DonationNew to add the cancelDonation function.
contract Donation {
mapping (address => uint) user_amounts;
/* DOES THIS METHODS MODIFY user_amounts of the Relay contract ??? */
function sendDonation(uint n) {
user_amounts[msg.sender] = user_amounts[msg.sender] + n
}
}
/**
* Ethereum Account Scanner
*
* To run this, you need your own geth node, accepting RPC
* connections on a port you can access.
*
* Install pre-requisites:
* sudo npm install -g web3
*
* Usage:
/**
* Base contract that all upgradeable contracts should use.
*
* Contracts implementing this interface are all called using delegatecall from
* a dispatcher. As a result, the _sizes and _dest variables are shared with the
* dispatcher contract, which allows the called contract to update these at will.
*
* _sizes is a map of function signatures to return value sizes. Due to EVM
* limitations, these need to be populated by the target contract, so the
* dispatcher knows how many bytes of data to return from called functions.
@niksmac
niksmac / Ethereum_testnet.md
Created September 3, 2016 13:10 — forked from 0mkara/Ethereum_private_network.md
Ethereum testnet configuration guide.

Create your own Ethereum testnet

Introduction

We will be using 3 virtual machines as 3 Ethereum node. We used 'Ubuntu Server 14.04 LTS trusty', and 'Ubuntu 15.10 wily' for this experiment. Root Ethereum node will be referred as 'root node', client nodes will be referred as 'client node A' & 'client node B' respectively. On root node port 30303 must be accessible from outside.

Installation

Below are the installation instructions for the latest versions of Ubuntu. This step must be executed and Ethereum go client 'geth' must be installed on every node.

@niksmac
niksmac / SiteMaintenanceTemplate.html
Last active November 13, 2023 14:52 — forked from pitch-gist/gist:2999707
Simple Maintenance Template Page - HTML CSS
<!DOCTYPE html>
<html lang="en">
<head>
<title>Site Maintenance</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
@niksmac
niksmac / config.json
Last active August 29, 2015 14:15 — forked from anonymous/config.json
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
<?php
/**
* Implements hook_preprocess_views_view_unformatted().
*/
function YOUR_THEME_preprocess_views_view_unformatted(&$variables) {
// Determine if this view's content should render in columns.
// @see: _YOUR_THEME_views_columns();
_YOUR_THEME_views_columns($variables, array(
'articles|page' => 2,
<html>
<head>
<title>jsonp test</title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('#select_link').click(function(e){
e.preventDefault();
console.log('select_link clicked');