Skip to content

Instantly share code, notes, and snippets.

View PierBover's full-sized avatar

Pier Bover PierBover

View GitHub Profile
@PierBover
PierBover / imageResizeSave.jsx
Last active August 29, 2015 14:25
Conditional resize image script for Photoshop. Creates thumbnail and large version and saves in JPEG.
var image = app.activeDocument;
var imageRatio = image.width / image.height;
// if your path has spaces you have to escape them, or use a path with no spaces
var folderThumbs = "/path/to/folder/thumbs";
var folderLarge = "/path/to/folder/large";
var thumbArea = {
width: 700,
height: 500
@PierBover
PierBover / keymap.xml
Created July 28, 2015 18:18
Kodi keymap for chinese USB remote
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<FullscreenVideo>
<keyboard>
<key id="61453">PlayPause</key>
<up>OSD</up>
<down>OSD</down>
<escape>Stop</escape>
</keyboard>
</FullscreenVideo>
@PierBover
PierBover / npm error
Created May 18, 2016 21:02
npm error
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-sync"
npm ERR! node v6.1.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! widgets-libros@1.0.0 build-sync: `npm run bundle-css && npm run build-js && npm run build-js-dependencies && npm run sync-repos && npm run bundle-css-XXXXXXXXXXXXX`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the widgets-libros@1.0.0 build-sync script 'npm run bundle-css && npm run build-js && npm run build-js-dependencies && npm run sync-repos && npm run bundle-css-XXXXXXXXXXXXX'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
{
"-KKPSjKwelbXG6Rq8AEh" : {
"-KKQqtg_a95p4Gm13XgZ" : {
"lorem-ipsum-dolor-si" : {
"body" : "\t<body>\n\t\tLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\t</body>",
"timestamp" : 1466171493149
},
"lorem-ipsum-dolor-si193" : {
"body" : "\t<body>\n\t\tLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat null
"rules": {
"semi": 2,
"no-extra-semi": 2,
"quotes": ["error", "single"],
"indent": ["error", "tab", {"SwitchCase": 1}],
"keyword-spacing": ["error", { "after": true }],
"space-before-blocks": "error",
"key-spacing": ["error", {"beforeColon": false, "afterColon": true}],
"space-in-parens": ["error", "never"],
"space-before-function-paren": ["error", "always"],
03-02 13:17:46.775 413 413 D SFPerfTracer: layers: (3:11) (FocusedStackFrame (0x7fb7145800): 0:2006)* (DimLayer (0x7fb716e800): 0:22)* (DimLayer (0x7fb30a9000): 0:731)* (DimLayer (0x7fb30aac00): 0:412)* (com.android.systemui.ImageWallpaper (0x7fb40c4000): 0:790)* (StatusBar (0x7fb320f800): 1:7869) (NavigationBar (0x7fb320c000): 0:52) (com.google.android.googlequicksearchbox/com.google.android.launcher.GEL (0x7fb3211400): 0:51)- (Starting io.cordova.hellocordova (0x7fb320dc00): 0:39)- (io.cordova.hellocordova/io.cordova.hellocordova.MainActivity (0x7fb3211400): 0:53)
03-02 13:17:46.998 17595 17595 D wpa_supplicant: wlan0: Control interface command 'SIGNAL_POLL'
03-02 13:17:47.006 17595 17595 D wpa_supplicant: wlan0: Control interface command 'PKTCNT_POLL'
03-02 13:17:47.157 666 666 I MSM-irqbalance: Decided to move IRQ131 from CPU1 to CPU3
03-02 13:17:47.999 17595 17595 D wpa_supplicant: wlan0: Control interface command 'SIGNAL_POLL'
03-02 13:17:48.006 17595 17595 D wpa_supplicant: wlan0: Contro
@PierBover
PierBover / Main.jsx
Created July 16, 2016 01:13
JWT Auth React Router async wait
import React from 'react'
export default class Main extends React.Component {
constructor(props){
super(props)
this.state = {}
}
componentWillMount(){
this.checkAuth()
@PierBover
PierBover / Component.vue
Created October 11, 2017 03:26
Charts.js integration with Vue without a wrapper
<template>
<div class='error'>
<h1>Test Charts.js</h1>
<canvas id='chart-canvas'></canvas>
</div>
</template>
<script>
import Chart from 'chart.js';
@PierBover
PierBover / key bindings
Created February 7, 2018 19:03
Pier Sublime configs
[
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" },
{ "keys": ["super+alt+down"], "command": "duplicate_lines" },
{ "keys": ["super+alt+up"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["alt+space"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["super+shift+a"], "command": "find_all_under" },
{ "keys": ["alt+minus"], "command": "jump_back" },
{ "keys": ["alt+shift+minus"], "command": "jump_forward" },
]
@PierBover
PierBover / index.js
Created November 1, 2018 14:00
Firebase cloud function admin init
const admin = require("firebase-admin");
const serviceAccount = require("./service-account.json");
if (admin.apps.length === 0) {
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://XXXXX.firebaseio.com"
});
}