Skip to content

Instantly share code, notes, and snippets.

Эти хосты блокируются на ТСПУ провайдеров для запрета YouTube в России. Для обхода запрета, добавьте в программы обхода (GoodbyeDPI/zapret) эти хосты:

googlevideo.com
ggpht.com
ytimg.com
l.google.com
youtube.com
play.google.com
youtubei.googleapis.com 
@lorisleiva
lorisleiva / AppWithLocalStorage.vue
Last active May 24, 2024 21:25
Abstraction of the local storage using Vue3's composition API
<script setup>
import useLocalStorage from './useLocalStorage'
const publicKey = useLocalStorage('solana-wallet-public-key')
</script>
<template>
<div>
<input type="text" v-model="publicKey">
<div v-text="publicKey"></div>
</div>
@lewebsimple
lewebsimple / setup-typescript.sh
Last active August 24, 2024 19:33
TypeScript / ESLint / Prettier / Vue 3
#!/bin/bash
yarn add -D @typescript-eslint/eslint-plugin \
typescript ts-node-dev \
@typescript-eslint/parser @typescript-eslint/eslint-plugin eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-vue prettier
cat > .eslintrc.js <<EOF
module.exports = {
root: true,
env: {
@wynand1004
wynand1004 / snake_game.py
Created September 2, 2018 08:56
A Simple Snake Game made in Python 3
# Simple Snake Game in Python 3 for Beginners
# By @TokyoEdTech
import turtle
import time
import random
delay = 0.1
# Score
@SilverFire
SilverFire / config.php
Created October 24, 2015 09:16
Yii2 set timezone for DB connection
<?php
return [
'components' => [
'db' => [
'class' => '\yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=demo',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
@msurguy
msurguy / List.md
Last active September 12, 2024 00:39
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@neara
neara / forms.py
Last active June 10, 2024 15:30
Django Class Based Views and Inline Formset Example
from django.forms import ModelForm
from django.forms.models import inlineformset_factory
from models import Sponsor, Sponsorship
class SponsorForm(ModelForm):
class Meta:
model = Sponsor
@mmrwoods
mmrwoods / postgres
Created January 20, 2012 13:47
Postgres maintenance crontab file
# dump all databases once every 24 hours
45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz
# vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night)
45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze"
45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet"
# re-index all databases once a week
0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database {};"'