Skip to content

Instantly share code, notes, and snippets.

@PEKTOP
PEKTOP / zappa_policy.json
Last active January 22, 2021 13:32
AWS AIM Policy for Zappa
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:AttachRolePolicy",
"iam:GetRole",
"iam:CreateRole",
"iam:PassRole",
CREATE TABLE `users` (
`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` varchar(100) NOT NULL
);
CREATE TABLE `transactions` (
`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
`user_id` int(11) NOT NULL,
`created` datetime NOT NULL,
`amount` decimal(8,2) NOT NULL,
@PEKTOP
PEKTOP / multpliers.py
Last active June 1, 2017 09:24
coin32
def multipliers():
return [(lambda y: (lambda x: x * y))(i) for i in range(4)]
print [m(2) for m in multipliers()]
@PEKTOP
PEKTOP / postgres_helper.txt
Last active January 27, 2016 11:03
A Cheat Sheet
POSTGRESQL
$ sudo su postgres -c psql postgres
postgres=# ALTER USER postgres WITH PASSWORD 'password';
postgres=# \q
$ sudo passwd -d postgres
$ sudo su postgres -c passwd
@PEKTOP
PEKTOP / frontendDevlopmentBookmarks.md
Created December 3, 2015 10:02 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@PEKTOP
PEKTOP / laravel_lumen_build.sh
Last active November 14, 2015 13:05
Build automation for Laravel and Lumen
#!/bin/bash
echo "[BUILD] start"
CURRENT_DIR="$( cd "$( dirname "$0" )" && pwd )"
echo "[BUILD] current directory is $CURRENT_DIR"
if ! command -v php >/dev/null; then
echo "[BUILD] php is required"
echo "[BUILD] finish"
exit 1
@PEKTOP
PEKTOP / VerifyEmail.php
Last active October 30, 2020 00:46
Verify Email address
<?php
use RuntimeException;
class VerifyEmail
{
/**
* @var string
*/
protected $email_user = '';
@PEKTOP
PEKTOP / Slug.php
Last active August 29, 2015 14:13
Slug
<?php
class Slug
{
/**
* @param string $string
* @return string
*/
public function make($string)
{
@PEKTOP
PEKTOP / create_user_for_every_database.php
Created November 18, 2014 19:54
Create granted user for every mysql database
<?php
$dns = 'mysql:dbname=mysql;host=localhost';
$db_user = 'root';
$db_password = 'admin';
$db_handler = new PDO($dns, $db_user, $db_password);
$statment = $db_handler->query('SHOW DATABASES');
$dbs = $statment->fetchAll();