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.

@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); }
@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 / 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 / README.md
Created May 30, 2019 06:02 — forked from claytonrcarter/README.md
Share named routes between Laravel and Javascript

Share named routes between Laravel and Javascript

This is a 2-part technique to share named routes between Laravel and Javascript. It uses a custom artisan command to export your named routes to JSON, and a Javascript route() helper to lookup the route and fill in any parameters. Written for Laravel 5.3; not tested in 5.4.

Installation

1. Install RouteJson.php

Copy RouteJson.php into your app as app/Console/Commands/RouteJson.php

@1242035
1242035 / git-clearHistory
Created June 22, 2018 04:13 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git
@1242035
1242035 / ecc.py
Created May 25, 2018 03:34 — forked from bellbind/ecc.py
[python]basics of elliptic curve cryptography
# Basics of Elliptic Curve Cryptography implementation on Python
import collections
def inv(n, q):
"""div on PN modulo a/b mod q as a * inv(b, q) mod q
>>> assert n * inv(n, q) % q == 1
"""
for i in range(q):
if (n * i) % q == 1:
var _ = require("lodash");
var path = require("path");
var env = process.env.NODE_ENV || "development";
var debug = ["development", "test"].indexOf(env) !== -1;
var defaults = {
cache: debug,
debug: debug,
@1242035
1242035 / queue-main.service
Created September 30, 2017 13:29 — forked from p34eu/queue-main.service
Laravel queue worker using systemd
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue-main.service
#
# run this command to enable service:
# systemctl enable queue-main.service
[Unit]
Description=Laravel queue worker
@1242035
1242035 / laravel-queue.service
Created September 30, 2017 13:28 — forked from thomasjsn/laravel-queue.service
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker