Skip to content

Instantly share code, notes, and snippets.

@0xjjpa
0xjjpa / TTAU_Crowdsale.sol
Created July 4, 2018 19:45
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.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.24;
import "github.com/OpenZeppelin/zeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsale.sol";
import "github.com/OpenZeppelin/zeppelin-solidity/contracts/crowdsale/emission/MintedCrowdsale.sol";
import "github.com/OpenZeppelin/zeppelin-solidity/contracts/token/ERC20/MintableToken.sol";
/**
* @title SampleCrowdsaleToken
* @dev Very simple ERC20 Token that can be minted.
@0xjjpa
0xjjpa / 3box.verification.v2
Created July 10, 2020 10:09
3Box Profile Verification 2020
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreiap3fps55yswcof4b6sg6kbuszh3y47q7w7jvyxlfmog24td5m75m ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@0xjjpa
0xjjpa / attestation.txt
Created September 6, 2021 19:49
Attestation
I contributed to the clr.fund Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: qvt32
Contributor # 808
Hash: undefined
Circuit: batchUst 32
Contributor # 735
Hash: bb9fc3f4 f88a6022 b36c0056 f649f3cb
8d532b96 9f579a7e ea31e68a 2e8d32c7
@Yaffle
Yaffle / Math.fma.js
Last active April 27, 2024 04:21
Math.fma - fused multiply–add (FMA) or fused multiply–accumulate (FMAC) in JavaScript
// a * b + c
// Math.fma - fused multiply–add (FMA) or fused multiply–accumulate (FMAC) in JavaScript
// For implementation details, see "The Handbook of Applied Cryptography"
// http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf
// and
// https://github.com/JuliaLang/openlibm/blob/master/src/s_fma.c
//!? BUGGY
(function () {
@KleskBY
KleskBY / reset.cfg
Created September 6, 2022 12:30
Counter-strike 1.6 CS 1.6 Factory reset CFG (ALL CVARS)
echo "Reset every console variable to its default state. Dumped out of the game"
echo "Protocol version 48"
echo "Exe version 1.1.2.7/Stdio (cstrike)"
echo "Exe build: 19:53:27 Aug 3 2020 (8684)"
echo "Can be used for viewing default cvar values and fixing CS without reinstalling the game."
unbindall
bind "TAB" "+showscores"
bind "ENTER" "+attack"
@MichelleDalalJian
MichelleDalalJian / py4e_ex_11
Created October 7, 2017 14:48
Extracting Data With Regular Expressions Finding Numbers in a Haystack In this assignment you will read through and parse a file with text and numbers. You will extract all the numbers in the file and compute the sum of the numbers. Data Files We provide two files for this assignment. One is a sample file where we give you the sum for your testi…
import re
hand = open("regex_sum_24962.txt")
x=list()
for line in hand:
y = re.findall('[0-9]+',line)
x = x+y
sum=0
for z in x:
@Yaffle
Yaffle / gist:1287361
Last active April 27, 2024 04:19
crc 32 in javascript
function crc32(s/*, polynomial = 0x04C11DB7, initialValue = 0xFFFFFFFF, finalXORValue = 0xFFFFFFFF*/) {
s = String(s);
var polynomial = arguments.length < 2 ? 0x04C11DB7 : (arguments[1] >>> 0);
var initialValue = arguments.length < 3 ? 0xFFFFFFFF : (arguments[2] >>> 0);
var finalXORValue = arguments.length < 4 ? 0xFFFFFFFF : (arguments[3] >>> 0);
var table = new Array(256);
var reverse = function (x, n) {
var b = 0;
@ncornette
ncornette / .xinitrc
Created December 4, 2014 09:15
.xinitrc for kiosk mode
#!/bin/sh
# invoke global X session script
#. /etc/X11/Xsession
# HOW-TO :
# 1. Disable any Display Manager (lightdm/gdm/gdm3) from executing on startup
# 2. Allow user to start X :
# a. Edit /etc/X11/Xwrapper.config
# b. Set value : "allowed_users=anybody"
# 3. insert "su kiosk -c xinit &" into /etc/rc.local
@yvele
yvele / get-npm-package-version.sh
Last active April 27, 2024 04:19
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
echo $PACKAGE_VERSION
@jmshal
jmshal / designer.html
Created August 15, 2014 23:22
designer
<link rel="import" href="../core-input/core-input.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;