Skip to content

Instantly share code, notes, and snippets.

@1242035
1242035 / composer-private-package-github-token.md
Created July 28, 2021 01:43 — forked from MikeiLL/composer-private-package-github-token.md
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.

Error:
$ adb devices
List of devices attached
52003c2b58b445db no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]
Fix:
1> sudo usermod -aG plugdev $LOGNAME (https://developer.android.com/studio/run/device)
2> lsusb
3> sudo vi /etc/udev/rules.d/51-android.rules
@1242035
1242035 / x-cart.conf
Created November 12, 2019 13:28
nginx x-cart.conf
server {
listen 80;
listen [::]:80;
root /home/cherry/Desktop/x-cart;
server_name x-cart.test;
index cart.php;
@1242035
1242035 / my.cnf
Created August 29, 2019 14:34
Install mysql service window
1. download mysql bin zip at: https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.17-winx64.zip
2. extract to H:\tools\mysql\8.0.17
3. add add H:\tools\mysql\8.0.17\bin t system path
4. create database dir: H:\tools\mysql\database
5. run command: mysqld --initialize --datadir=H:\tools\mysql\database
6. install service by command: mysqld --install me-server-mysqld --defaults-file=H:\tools\mysql\conf\my.cnf
7. create text file passwors.txt
8. set password for user root: mysqld --defaults-file=H:\tools\mysql\conf\my.cnf --init-file=H:\tools\mysql\conf\password.txt
9. start service
@1242035
1242035 / base64-utf8.module.js
Created August 13, 2019 09:36 — forked from nijikokun/base64-utf8.module.js
Javascript Base64 UTF8 for the Browser / Server. Base64 UTF-8 Encoding and Decoding Libraries / Modules for AMD, CommonJS, Nodejs and Browsers. Cross-browser compatible.
// UTF8 Module
//
// Cleaner and modularized utf-8 encoding and decoding library for javascript.
//
// copyright: MIT
// author: Nijiko Yonskai, @nijikokun, [email protected]
(function (name, definition, context, dependencies) {
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); }
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); }
else { context[name] = definition.apply(context); }
const HOST_URL = process.env.BASE_URL || 'http://localhost:3000';
//const API_URL = process.env.BASE_API_URL || 'http://14.225.11.12:3030/api/client';
const API_URL = process.env.BASE_API_URL || 'http://localhost:3000';
const webpack = require("webpack");
module.exports = {
mode: 'spa',
@1242035
1242035 / notification.js
Created August 8, 2019 14:54 — forked from emilio/notification.js
window.Notification polyfill
/*
* window.Notification polyfill
* @author Emilio Cobos (http://emiliocobos.net)
*/
/* try prefixed */
if( ! window.Notification ) {
window.Notification = (function() {
return window.Notification || window.webkitNotification || window.mozNotification || window.oNotification || window.msNotification;
})()
@1242035
1242035 / command.txt
Created August 6, 2019 02:48
config mysql service use nssm window
1. add mysql/bin to enviroment to system path
2. create database dir D:\server\mysql\data
3. create config dir: D:\server\mysql\conf
4. run init server : mysqld --defaults-file=D:\server\mysql\conf\my.ini --initialize --console
5. run nssm install mysql-server
- path: browser to mysqld.exe
- argruments: --defaults-file=D:\server\mysql\conf\my.ini --console
6. done
@1242035
1242035 / spree_backend_only.md
Created August 1, 2019 02:35 — forked from harssh/spree_backend_only.md
Use spree backend only ........

Set up a Spree backend only install

rails new store-backend

Gemfile

gem 'spree_backend', github: 'spree/spree'
@1242035
1242035 / httpd-vhosts.conf
Last active September 13, 2023 13:34
enable gzip xampp apache
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "D:\web\public"
ServerName example.test
<Directory D:\web\public>
Require all granted
AllowOverride All
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml