Skip to content

Instantly share code, notes, and snippets.

View ch3ll0v3k's full-sized avatar

Timoschenko Viacheslau ch3ll0v3k

View GitHub Profile
@simonhlee97
simonhlee97 / vuejs.md
Last active February 21, 2019 01:20
Net Ninja's Vue.js Course

video #22: Props

in Vue.js, data gets passed down as a prop from one component to another.


video #23: Primitive vs Reference Types

primitive types are STRINGS, BOOLEANS, and NUMBERS reference types are OBJECTS and ARRAYS

@ulymarins
ulymarins / aes.java
Last active October 6, 2020 11:18
Java Encryption with AES
import java.math.BigInteger;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.util.Random;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
const key = (x, y) => {
return x + ',' + y
}
const unkey = k => {
return k.split(',').map(s => parseInt(s))
}
/* Given an x, y coordinate and a hashmap "x,y" => boolean values that indicate whether or not the tile at that
coordinate is blocked, this function will calculate the bitmask sum of the given coordinate. */
function computeBitmask(x, y, blockedCells) {
//author @TraderX0
//script to plot daily Open high and low
//version 1.1
//last edited 22/11/2018
//title
study(title="TraderX0__O_H_L", shorttitle="TraderX0_O_H_L", overlay=true)
// holds the daily price levels
openPrice = security(tickerid, 'D', open)
var R = require('ramda');
void 0; //to not bloat the output
var random = require('seed-random')(1337);
var data = [
{input: [0, 0], output: 0},
{input: [1, 0], output: 1},
{input: [0, 1], output: 1},
{input: [1, 1], output: 0},
];
var activation_sigmoid = x => 1 / (1 + Math.exp(-x));
@Swader
Swader / demo.php
Created February 17, 2014 13:47
Mehul Jain's captcha sample
<?php
session_start();
$_SESSION['count'] = time();
$image;
?>
<title>demo.php</title>
<body style="background-color:#ddd; ">
<?php
@stavros-k
stavros-k / 14ACN6-tlp1.4.md
Created August 21, 2021 22:41
TLP 1.4 Test: Battery Care for Lenovo IdeaPad 5 Pro (AMD) 14'' Gen 6

SYSTEM

LENOVO IdeaPad 5 Pro 14ACN6 82L7

Enable conservation

Edit /etc/tlp.conf

~$ cat /etc/tlp.conf | grep STOP_CHARGE_THRESH_BAT0
STOP_CHARGE_THRESH_BAT0="1"
@nzjrs
nzjrs / Makefile
Created May 25, 2011 07:09
Python ctypes example
all: test libtest.so testmodule
libtest.so: libtest.c
$(CC) -Wall -g -fPIC -shared -o $@ $? -lc
test: test_main.c libtest.o
$(CC) -o $@ $?
testmodule: testmodule.c
python setup.py build
@raineorshine
raineorshine / sendRawTransaction.js
Last active December 3, 2022 18:02
Sends a raw transaction with web3 v1.2.2, ethereumjs-tx v2.1.1, and Infura
const Web3 = require('web3')
const Tx = require('ethereumjs-tx').Transaction
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY'))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privateKey = new Buffer('PRIVATE_KEY', 'hex')
echo-server-epoll
echo-server-poll
talk
talk.dSYM