Skip to content

Instantly share code, notes, and snippets.

@helxsz
helxsz / letsencrypt_2019.md
Created June 17, 2019 12:23 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@helxsz
helxsz / ng-update-v6.js
Created July 30, 2018 10:23 — forked from leo6104/ng-update-v6.js
Convert .angular-cli.json to angular.json (for Angular 6 Migration from Angular 2/4/5)
/**
* Created by leo6104 (github.com/leo6104)
* You can use this nodejs script on angular v5/v4/v2 project.
* 1. Place this gist file `ng-update-v6.js` to angular project's root path
* 2. use command `node ng-update-v6.js .angular-cli.json`
* 3. check angular.json file (created by ng-update-v6.js)
**/
const fs = require('fs');
const path = require('path');
@helxsz
helxsz / 0x_Tutorial_1.js
Created May 23, 2018 13:52 — forked from dmitryn/0x_Tutorial_1.js
0x.js Tutorial on how to create, validate and fill an order
const Web3 = require('web3');
const ZeroEx = require('0x.js').ZeroEx;
const BigNumber = require('bignumber.js');
// Default provider for TestRPC
const provider = new Web3.providers.HttpProvider('http://localhost:8545')
// Calling constructor
const zeroEx = new ZeroEx(provider);
sendSigned(txData,wallet_privatekey, cb) {
var web3 = this.web3;
const tx = new Tx(txData)
var _pk = wallet_privatekey.slice(2);
var privateKey = new Buffer(_pk, 'hex');
tx.sign(privateKey)
const serializedTx = tx.serialize()
web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex'), cb)
}
@helxsz
helxsz / tryEthereum.js
Created November 25, 2017 09:14 — forked from qx133/tryEthereum.js
Try out Ethereum using only nodejs and npm!
var Web3 = require('web3');
var util = require('ethereumjs-util');
var tx = require('ethereumjs-tx');
var lightwallet = require('eth-lightwallet');
var txutils = lightwallet.txutils;
var web3 = new Web3(
new Web3.providers.HttpProvider('https://rinkeby.infura.io/')
);
var address = '0x8D68583e625CAaE969fA9249502E105a21435EbF';
var key = '1ce642301e680f60227b9d8ffecad474f15155b6d8f8a2cb6bde8e85c8a4809a';
@helxsz
helxsz / Ballot.sol
Created November 25, 2017 09:10
ballot smart contract
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@helxsz
helxsz / annotation.py
Created September 8, 2017 08:55
annotate the parking images
# -*- coding: UTF-8 -*-
import cv2
import numpy as np
import os
import random
def car_position(input_file):
position = []
img_gray = cv2.imread(input_file,cv2.IMREAD_GRAYSCALE)
@helxsz
helxsz / google satellite map
Last active August 30, 2017 09:13
google satellite map
53.380827, -2.975304
53.385516, -2.981218
53.385041, -2.980835
53.384792, -2.980543
53.384661, -2.982629
53.384059, -2.981964
53.383523, -2.981326
53.383448, -2.979853
53.383102, -2.979456
53.383349, -2.978617
@helxsz
helxsz / texture_change.py
Created August 23, 2017 01:21 — forked from diramazioni/texture_change.py
blender python: texture change from command line
'''
texture image path are relative to the blend file directory. run from command line like this:
texture=img/2012720989_c.jpg blender -b mug.blend --python texture_change.py -F PNG -s 1 -e 1 -j 1 -t 0 -a
''''
import os
image_file = os.getenv('texture')
if not image_file:
image_file="img/2012720989_c.jpg"
@helxsz
helxsz / readme.md
Created August 19, 2017 14:11 — forked from nitish11/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman