Skip to content

Instantly share code, notes, and snippets.

View thestuntcoder's full-sized avatar
🇨🇭

Dean Starkmann thestuntcoder

🇨🇭
View GitHub Profile
@thestuntcoder
thestuntcoder / company_no.py
Created July 6, 2022 10:43
Find Norwegian company IDs by company name (simple example)
# -*- coding: utf-8 -*-
import sys
import urllib3
from bs4 import BeautifulSoup
# Examples how to run this script:
# python3 company_no.py jumpking
# python3 company_no.py coca_cola
def main():
{
"retainer_hours": X,
"currency": "eur",
"bank": "ca",
"price_per_hour": N,
"net_payment": "Valuta: 30 dana od dana izdavanja fakture. / Terms: please pay within 30 days of receiving this invoice.",
"additional_billable_items": {
"Usluge održavanja servera za period od jednog meseca. / Hosting services for period of one month.": 50,
"CDN isporuka resursa na sajtu. / CDN delivery of website resources.": 20,
"Optimizacija slika na serveru. / Server-side image optimization.": 40
pragma solidity ^0.4.18;
contract Miles {
uint8 public miles;
function Voting() public {
miles = 1;
}
var Web3 = require('web3');
var solc = require('solc');
var fs = require('fs');
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
//replace this with whatever is your local user address
var userAddress = '0x143a7c5eb8cf1c4f72460b8d29d686b3399bb0f9';
var compiledCode = solc.compile(fs.readFileSync('Miles.sol').toString());
@thestuntcoder
thestuntcoder / magento2-increase-sequence-start-number.sql
Created June 28, 2017 17:50
Magento 2 increase sequence start number
ALTER TABLE `sequence_creditmemo_1` AUTO_INCREMENT=33000
ALTER TABLE `sequence_invoice_1` AUTO_INCREMENT=33000
ALTER TABLE `sequence_order_1` AUTO_INCREMENT=33000
ALTER TABLE `sequence_shipment_1` AUTO_INCREMENT=33000
@thestuntcoder
thestuntcoder / magento-admin-user-via-database.sql
Created December 10, 2016 10:43
Create Magento Admin User Through Database
LOCK TABLES `admin_role` WRITE , `admin_user` WRITE;
SET @SALT = "rp";
SET @PASS = CONCAT(MD5( CONCAT(@SALT, "super_secure_password") ), CONCAT(":", @SALT));
SELECT @EXTRA := MAX(extra) FROM admin_user WHERE extra IS NOT NULL;
INSERT INTO `admin_user` (firstname, lastname, email, username, password, created, lognum, reload_acl_flag, is_active, extra, rp_token_created_at)
VALUES ('FirstName', 'LastName', 'email@yourdomain.com', 'your_username', @PASS,NOW(), 0, 0, 1, @EXTRA,NOW());
INSERT INTO `admin_role` (parent_id, tree_level, sort_order, role_type, user_id, role_name)
header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
header("Pragma: no-cache"); // HTTP 1.0.
header("Expires: 0"); // Proxies.
// get the last order
$lastOrderId = $this->_getOnepage()->getCheckout()->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
// Add the comment and save the order (last parameter will determine if comment will be sent to customer)
$order->addStatusHistoryComment('This comment is programatically added to last order in this Magento setup');
$order->save();