Skip to content

Instantly share code, notes, and snippets.

@mawi12345
mawi12345 / README.txt
Created February 22, 2021 07:33
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.6+commit.7338295f.js&optimize=false&runs=200&gist=
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
@mawi12345
mawi12345 / README.txt
Created February 22, 2021 07:32
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.6+commit.7338295f.js&optimize=false&runs=200&gist=
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
@mawi12345
mawi12345 / README.txt
Created February 22, 2021 07:30
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.6+commit.7338295f.js&optimize=false&runs=200&gist=
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
@mawi12345
mawi12345 / app.js
Last active November 8, 2015 09:51
SSL & socket.io
'use strict';
var fs = require('fs');
var protocol = 'https';
var sslOptions = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem'),
};
@mawi12345
mawi12345 / microseconds.php
Last active August 29, 2015 14:03
php microseconds
<?php
// Only the microseconds.
// Use it in addition to `DateTime`.
$microseconds = intval(substr(explode(' ', microtime())[0], 2, 6));
@mawi12345
mawi12345 / gist:11003253
Created April 17, 2014 18:30
hearthstone 2014-04-17 iPad2,2 iOS7.0.6
Incident Identifier: *
CrashReporter Key: *
Hardware Model: iPad2,2
OS Version: iPhone OS 7.0.6 (11B651)
Kernel Version: Darwin Kernel Version 14.0.0: Fri Sep 27 23:00:48 PDT 2013; root:xnu-2423.3.12~1/RELEASE_ARM_S5L8940X
Date: 2014-04-17 19:59:54 +0200
Time since snapshot: 175 ms
Free pages: 1125
Active pages: 3678
package org.se.lab;
public class HTMLEncoder
{
private static String enities[] = {"&", "<", ">", "\"", "'"};
private static String encoded[] = {"&amp;", "&lt;", "&gt;", "&quot;", "&apos;"};
public static String encodeForHTML(String s)
{
@mawi12345
mawi12345 / memory_segments.c
Last active December 24, 2015 15:59
just an better looking version of memory_segments.c
#include <stdio.h>
#include <stdlib.h>
int global_var;
int global_initialized_var = 5;
void * function()
{
int stack_var;
@mawi12345
mawi12345 / create-client
Created November 30, 2012 08:57
openvpn easy-rsa2 create server and client scripts
#!/bin/bash
NAME=$1
if [ -z "$NAME" ]
then
echo "create-client NAME"
exit
fi
source ./server.vars
@mawi12345
mawi12345 / dummy.js
Created October 31, 2012 14:24
JQuery plugin dummy bootstrap style
!function ($) {
"use strict"; // jshint ;_;
/* MyPlugin DUMMY CLASS DEFINITION */
var MyPlugin = function (element, options) {
this.options = options
this.$element = $(element)
this.init();