Skip to content

Instantly share code, notes, and snippets.

View juanpasolano's full-sized avatar
💻
Making

Juan Pablo Solano juanpasolano

💻
Making
View GitHub Profile
@ziaulrehman40
ziaulrehman40 / CheckboxAdapter.jsx
Created November 24, 2019 13:16
Shopify-polaris components wrappers for react-final-form
import React from 'react'
import { Checkbox } from '@shopify/polaris'
export default function CheckboxAdapter({ input, meta, ...rest }) {
return (
<Checkbox
{...input}
{...rest}
error={meta.touched && meta.error}
onChange={(value) => {
@juanpasolano
juanpasolano / app.jsx
Last active May 1, 2021 00:32
Sage 9 Wordpress theme
import React from "react";
import ReactDOM from "react-dom";
import "babel-polyfill";
const App = ()=> {
return <h1>I'm an app</h1>
}
const init = () => {
ReactDOM.render(<App />, document.getElementById("reactApp"));
@nijicha
nijicha / install_nodejs_and_yarn_homebrew.md
Last active January 30, 2024 12:14
Install NVM, Node.js, Yarn via Homebrew
@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active February 13, 2024 07:34
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@jimthedev
jimthedev / typescript.json
Created September 23, 2015 05:16
A few Visual Studio Code 0.8 Snippets for TypeScript and Angular 2
{
"New NG2 Component (Item)": {
"prefix": "ng2c",
"body": [
"import {Component, View, CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/angular2';",
"// import {ExampleListComponent} from '../example/example-list.component';",
"",
"@Component({",
" selector: '${1:dashed-name}',",
" properties: ['id']",
@spyesx
spyesx / string-to-slug.js
Last active March 15, 2024 12:05
String to slug in JS (wordpress sanitize_title)
var string_to_slug = function (str)
{
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;";
var to = "aaaaeeeeiiiioooouuuuncescrzyuudtn------";
for (var i=0, l=from.length ; i<l ; i++)
@mandiwise
mandiwise / Update remote repo
Last active May 2, 2024 08:59
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@angelix
angelix / angular-csrf-interceptor
Last active July 3, 2017 15:50
AngularJS CSRF Request Interceptor (for SailsJS)
app.factory('csrfRequestInterceptor' , function($q , $injector){
var _token = false;
return {
request : function(config){
var CSRF_URL = '/csrfToken';
if(config.url == CSRF_URL || config.method == "GET"){
return config;
}
// sailsjs hasn't time limit for csrf token, so it is safe to cache this
// remove this to request a new token
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore