Skip to content

Instantly share code, notes, and snippets.

@bajcmartinez
bajcmartinez / smart_contract.sol
Last active January 5, 2023 19:16
Access a Smart Contract from your web application
pragma solidity ^0.6.6;
contract CoolNumberContract {
uint public coolNumber = 10;
function setCoolNumber(uint _coolNumber) public {
coolNumber = _coolNumber;
}
}
@PaulKinlan
PaulKinlan / criticalcss.html
Last active March 15, 2023 02:13
Detect Critical CSS
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<h2>Original CSS</h2>
<style style="display: block; white-space: pre; font-family: monospace">
h2 { margin:0; }
@henninghorn
henninghorn / Nordnet.php
Created March 24, 2012 13:39
Prints out instruments in C20
<?php
class Nordnet {
public $base_url;
public function __construct($username, $password, $service = 'NEXTAPI', $base_url = 'api.test.nordnet.se/next', $api_version = '1')
{
// Step 1: First Base64-encode the username, password and timestamp (UNIX timestamp in milliseconds) and combine them with the character ‘:’.
$login_string = base64_encode($username) . ':' . base64_encode($password) . ':' . base64_encode(microtime());
@havardgulldahl
havardgulldahl / websocketserver.py
Created November 28, 2010 23:10 — forked from mumrah/websocketserver.py
Python WebSocket server (single thread)
# -*- encoding: utf8 -*-
#
# Simple WebSockets in Python
# By Håvard Gulldahl <havard@gulldahl.no>
#
# Based on example by David Arthur (he did all the hard work :)
# https://gist.github.com/512987
#
import struct
@jaywilliams
jaywilliams / convert_ascii.php
Created May 28, 2009 19:25
This simple function will remove any non-ASCII character. Feel free to fork and extend!
<?php
/**
* Remove any non-ASCII characters and convert known non-ASCII characters
* to their ASCII equivalents, if possible.
*
* @param string $string
* @return string $string
* @author Jay Williams <myd3.com>
* @license MIT License
* @link http://gist.github.com/119517