Skip to content

Instantly share code, notes, and snippets.

Ryosuke whoisryosuke

Block or report user

Report or block whoisryosuke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
whoisryosuke / git-private-clone.bash
Created Jul 15, 2019
Git/Dev Ops - Clone from private repo (into a remote server / locally / etc) - via:
View git-private-clone.bash
git clone .
whoisryosuke / copy.bash
Created Jul 11, 2019
Copy SSH key to clipboard
View copy.bash
pbcopy < ~/.ssh/
whoisryosuke / massInsertOrUpdate.php
Created Jun 18, 2019 — forked from RuGa/massInsertOrUpdate.php
Mass (bulk) insert or update on duplicate for Laravel 4/5
View massInsertOrUpdate.php
* Mass (bulk) insert or update on duplicate for Laravel 4/5
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
* @param array $rows
View jquery-iife-boilerplate.js
// IIFE keeps all code out of global scope
(function($, window, document) {
// The $ is now locally scoped
$(function() {
// The DOM is ready!
// equiv of $(document).ready(function () {
}(window.jQuery, window, document));


{% paginate collection.products by 20 %}
    <!-- START PRODUCTS -->
    {% for product in collection.products %}
    	    <div class="product" id="product-{{ forloop.index | plus:paginate.current_offset }}">
                {% include 'product' with product %}

Create a snippet named "dump.liquid" with the following code snippet
Note: if you use a different filename for the liquid snippet, make sure the variable being passed through liquid's json filter is also the same name, otherwise this shorthand usage won't work as expected

<script type="text/javascript">
 console.log({{ dump | json }});

Usage in template files:

View usePromise.js
import { useState, useEffect, useCallback } from 'react'
function usePromise(createPromise) {
const [error, setError] = useState()
const [value, setValue] = useState()
useEffect(() => {
let current = true

2019: try hooks + promise debouncing

This is the most up to date version of how I would solve this problem. I would use:

This is some initial wiring but you are composing primitive blocks on your own, and you can make your own custom hook so that you only need to do this once.

whoisryosuke /
Created May 12, 2019 — forked from zephraph/
Clean up node_modules
node_modules=$(find $SEARCH_PATH -name "node_modules" -type d -prune)
You can’t perform that action at this time.