Skip to content

Instantly share code, notes, and snippets.

View xlanex6's full-sized avatar
🎿
Code web apps from the alps

Alex Duval xlanex6

🎿
Code web apps from the alps
View GitHub Profile
@danielroe
danielroe / settings.json
Last active March 21, 2024 06:26
VScode settings for a minimal UI
{
// Disable telemetry
"telemetry.telemetryLevel": "off",
// Zen mode
"zenMode.fullScreen": false,
"zenMode.hideTabs": true,
"zenMode.centerLayout": false,
// Theming
"workbench.iconTheme": "city-lights-icons-vsc",
"editor.fontFamily": "Dank Mono",
@karantir
karantir / index.js
Created January 26, 2019 09:09
Play sound with Howler from blob stored in IndexedDB
(function () {
// IndexedDB
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB,
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction,
dbVersion = 2.0;
// Create/open database
var request = indexedDB.open("soundScapeFiles", dbVersion),
db,
createObjectStore = function (dataBase) {
provider "aws" {
version = "~> 1.9"
region = "eu-central-1"
}
resource "aws_kms_key" "mykey" {
description = "This key is used to encrypt bucket objects"
deletion_window_in_days = 10
}
resource "aws_s3_bucket" "mybucket" {
@Sinequanonh
Sinequanonh / telegram-bot.js
Last active October 25, 2023 06:09
Nodejs script to send Telegram push notifications
const TelegramBot = require('node-telegram-bot-api');
// replace the value below with the Telegram token you receive from @BotFather
const token = YOUR_TOKEN;
// read the doc from https://github.com/yagop/node-telegram-bot-api to know how to catch the chatId
const chatId = CHAT_ID;
const bot = new TelegramBot(token, { polling: false });
const telegrambot = (message, json) => {
@liborvanek
liborvanek / transition.js
Last active April 26, 2023 11:43
Page transition mixin for Nuxt.js with GreenSock GSAP
import { TimelineMax, TweenMax, Power2, Back } from 'gsap'
let curtainsOpenTimeline = () => {
return new TimelineMax()
.set('.curtains', { transformOrigin: '0%' })
.fromTo('.curtains', 0.6, { scaleX: 0 }, { scaleX: 1, ease: Power2.easeInOut })
.fromTo('.curtains-logo', 0.3, { x: '-100%', autoAlpha: 0 }, { x: '-50%', autoAlpha: 1, ease: Power2.easeInOut }, '-=0.45')
}
let curtainsCloseTimeline = () => {
@kingkool68
kingkool68 / index.js
Created November 14, 2017 18:33
AWS Lambda Function for Proxying Requests to S3
/**
* This is a simple AWS Lambda function that will look for a given file on S3 and return it
* passing along all of the headers of the S3 file. To make this available via a URL use
* API Gateway with an AWS Lambda Proxy Integration.
*
* Set the S3_REGION and S3_BUCKET global parameters in AWS Lambda
* Make sure the Lambda function is passed an object with `{ pathParameters : { proxy: 'path/to/file.jpg' } }` set
*/
var AWS = require('aws-sdk');
@przbadu
przbadu / _vue-rails.md
Last active July 16, 2022 21:48
Vue js and Rails integration

Setup Rails and Vuejs

  1. Generate new rails app using --webpack flag
rails new myApp --webpack=vue

Note:

  1. You can use --webpack=angular for angular application and --webpack=react for react.
@islishude
islishude / caret.js
Last active November 26, 2023 00:16
[DEPRECATED]get/set caret position in contentEditable or textarea/input element(JavaScript)
/**
* @file get/set caret position and insert text
* @author islishude
* @license MIT
*/
export class Caret {
/**
* get/set caret position
* @param {HTMLColletion} target
*/
@yann-yinn
yann-yinn / app.css
Created August 14, 2017 11:19
Page transitions slide effect example with Nuxt.js and Vue.js
// only for desktop for now,
@media screen and (min-width: 1008px) {
/* during entering and leaving : */
.page-enter-active, .page-leave-active {
position:absolute;
max-width:725.328px; /*make sur our content keep it's original width*/
transition: all .2s ease;
}
anonymous
anonymous / snippets.json
Created May 28, 2017 21:48
Emmet ERB snippet
{
"variables": {
"lang": "en",
"locale": "en-US",
"charset": "UTF-8",
"indentation": "\t",
"newline": "\n"
},
"css": {