Skip to content

Instantly share code, notes, and snippets.

View samwolf1982's full-sized avatar

samwolf1982

  • Team Lead "Dev Best"
  • Ukraine, Lviv
View GitHub Profile
@samwolf1982
samwolf1982 / AllGattCharacteristics.java
Created March 16, 2025 08:39 — forked from sam016/AllGattCharacteristics.java
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
#!/bin/bash
# Перевірка переданих аргументів
if [ -z "$1" ]; then
echo "❌ Помилка: Вкажіть тег для пошуку!"
echo "📌 Приклад використання: ./download_pexels.sh \"beautiful sunset\" large"
exit 1
fi
# Pexels API ключ (замініть на свій)
@samwolf1982
samwolf1982 / gist:01a00dcf4735828fc76b46ecfa5be051
Created March 8, 2025 06:36
renaming all files random name no recursive
#!/bin/bash
cd /home/sam/Pictures/own_wallpapers/List_dynamic_wallpapers_v2 || exit
for file in *; do
ext="${file##*.}" # Отримуємо розширення
new_name=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 10) # Генеруємо випадковий рядок (10 символів)
if [[ "$file" == *.* ]]; then
mv "$file" "${new_name}.${ext}" # Додаємо крапку перед розширенням
else
mv "$file" "${new_name}" # Якщо немає розширення, просто унікальне ім'я
fi
<script setup>
import {onMounted, ref} from "vue";
import {useQuasar} from "quasar";
import Notify from "@/components/UI/Notify.vue";
import {useApi} from "@/api/Api";
import {useState} from "@/hooks/useState";
import {computed} from "vue";
import {useStore} from "vuex";
import * as types from "@/store/actionTypes/actionTypes";
docker run -it --rm -p 8080:8080 --name web-app -v $(pwd):"/usr/src/app" duaneleem/live-server:1.0
@samwolf1982
samwolf1982 / Dockerfile-prod1
Created December 27, 2020 02:28 — forked from yossisp/Dockerfile-prod1
nginx setup for multiple docker-compose containers (react.js app, node.js server)
# Dockerfile for react.js app and nginx
# build environment
FROM node:8-alpine as builder
WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH
COPY package.json /usr/src/app/package.json
RUN npm install
COPY . /usr/src/app
RUN npm run build --loglevel verbose
@samwolf1982
samwolf1982 / string-dot-notation-to-object
Created June 4, 2020 18:32 — forked from brianmriley/string-dot-notation-to-object
Convert Javascript string in dot notation into an object reference
// pulled from SO http://stackoverflow.com/questions/6393943/convert-javascript-string-in-dot-notation-into-an-object-reference
// NOTE: Array.reduce() may not be available in older browsers
function index(obj,i) {return obj[i]}
'a.b.etc'.split('.').reduce(index, obj);
var obj = {a:{b:{etc:5}}};
index(obj,'a.b.etc');
@samwolf1982
samwolf1982 / Dockerfile
Created September 29, 2019 14:14 — forked from kubaceg/Dockerfile
Docker install ioncube extension (php 5.6)
RUN curl -o ioncube.tar.gz http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \
&& tar -xvvzf ioncube.tar.gz \
&& mv ioncube/ioncube_loader_lin_5.6.so `php-config --extension-dir` \
&& rm -Rf ioncube.tar.gz ioncube \
&& docker-php-ext-enable ioncube_loader_lin_5.6
@samwolf1982
samwolf1982 / js-get-fn-name.js
Created April 28, 2018 18:26 — forked from dfkaye/js-get-fn-name.js
get a javascript function name
function getFnName(fn) {
var f = typeof fn == 'function';
var s = f && ((fn.name && ['', fn.name]) || fn.toString().match(/function ([^\(]+)/));
return (!f && 'not a function') || (s && s[1] || 'anonymous');
}
console.log(getFnName(String)); // 'String'
console.log(getFnName(function test(){})); // 'test'
console.log(getFnName(function (){})); // 'anonymous'
@samwolf1982
samwolf1982 / _bootstrap-sass-xl.scss
Created January 15, 2018 23:31 — forked from juukie/_bootstrap-sass-xl.scss
Add xl step to bootstrap sass. Should be after bootstrap.scss.
/* Place this after bootstrap.scss */
$screen-xl: 1560px !default;
$screen-xl-min: $screen-xl !default;
$screen-xl-desktop: $screen-xl-min !default;
$screen-lg-max: ($screen-xl-min - 1) !default;
$container-xlarge-desktop: (1530px + $grid-gutter-width) !default;
$container-xl: $container-xlarge-desktop !default;
.container {