Skip to content

Instantly share code, notes, and snippets.

View decebal's full-sized avatar
🥑

Decebal Dobrica decebal

🥑
View GitHub Profile
@decebal
decebal / .deps...npm...hardhat...console.sol
Created January 21, 2024 00:35
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.8.3+commit.8d00100c.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
library console {
address constant CONSOLE_ADDRESS =
0x000000000000000000636F6e736F6c652e6c6f67;
function _sendLogPayloadImplementation(bytes memory payload) internal view {
address consoleAddress = CONSOLE_ADDRESS;
/// @solidity memory-safe-assembly
@decebal
decebal / grpc_asyncio.py
Created February 15, 2018 13:01 — forked from mmellison/grpc_asyncio.py
gRPC Servicer with Asyncio (Python 3.6+)
import asyncio
from concurrent import futures
import functools
import inspect
import threading
from grpc import _server
def _loop_mgr(loop: asyncio.AbstractEventLoop):
@decebal
decebal / http_get.go
Last active April 13, 2016 13:46 — forked from ijt/http_get.go
Example of using http.Get in go (golang)
package main
import (
"fmt"
"http"
"io/ioutil"
"os"
)
func main() {
@decebal
decebal / gist:4258064
Created December 11, 2012 12:04
js check
$("#countyCheck").change(function() {
$.ajax({
type: "GET",
url: "index.php?page=checkout&action=getcities&countyCheck=" + $(this).val(),
success: function(data) {
//console.log(data);
console.log(data);
$("#cityCheck").html(data);
}
});
@decebal
decebal / gist:4117271
Created November 20, 2012 10:55
Mysql Client
To backup:
mysqldump -u user -p DATABASE > backup.sql
To import:
mysql -u user -p DATABASE < backup.sql
# --------------------------------------------
# General
# --------------------------------------------
set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments.
set :application, "domain.com" # Application name
set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ...
# --------------------------------------------
# Server
# --------------------------------------------
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' WITH GRANT OPTION;
@decebal
decebal / gist:3832373
Created October 4, 2012 09:04
exclude rsync
--exclude 'cs-photos/products'
@decebal
decebal / change_collation.sql
Created October 1, 2012 12:14
Change table collation
alter table csshop_products_prospect convert to character set utf8 collate utf8_general_ci
@decebal
decebal / gist:3720107
Created September 14, 2012 06:07
Lilly
usort($result, function($a, $b){
if($a['sortkey'] == $b['sortkey']){
return 0;
}else{
return ($a['sortkey'] > $b['sortkey']) ? 1: -1;
}
});