Skip to content

Instantly share code, notes, and snippets.

View joshuapinter's full-sized avatar
🎯
Focusing

Joshua Pinter joshuapinter

🎯
Focusing
View GitHub Profile
@chendesheng
chendesheng / DoubleClickAtCaretCommand.py
Created January 9, 2023 14:25
Sublime Text jump to file from Find Results using keyboard
import sublime
import sublime_plugin
class DoubleClickAtCaretCommand(sublime_plugin.TextCommand):
def run(self, edit, **kwargs):
view = self.view
cursor = view.sel()[0]
(rg, scope) = view.extract_tokens_with_scopes(view.line(cursor))[1]
if 'line-number.match.find-in-files' in scope:
@joshuapinter
joshuapinter / .npmrc
Created March 14, 2019 17:01
Common Configuration Files
save-exact = true # Saves exact version without needing --save-exact.
@rjnienaber
rjnienaber / install.sh
Created September 6, 2018 10:29
Compile ImageMagick with WEBP and HEIC support on Ubuntu 16.04
# $ lsb_release -a
# No LSB modules are available.
# Distributor ID: Ubuntu
# Description: Ubuntu 16.04.5 LTS
# Release: 16.04
# Codename: xenial
# $ uname -a
# Linux xps 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
@akabab
akabab / rm_mysql.md
Last active November 14, 2018 20:26 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@waynebloss
waynebloss / README.md
Last active February 3, 2022 15:22
Testing yarn alias with Deep Dependencies

Testing yarn alias with Deep Dependencies

Yarn tip: You can alias a package by using yarn add fake-name@npm:left-pad. Now you can use require("fake-name") to require left-pad.

This could be useful for module level dependency injection or inversion of control...

@karlhorky
karlhorky / .yarnrc
Last active January 7, 2022 13:25
Configure Yarn's --silent flag with .yarnrc configuration file
--silent true
@shieva
shieva / index.js
Created February 4, 2018 03:26
change timestamp of files in nodejs
const moment = require('moment');
const fs = require('fs');
var Utimes = require('@ronomon/utimes');
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
const folder = '100';
const files = fs.readdirSync(folder);
// console.log(files)
async function changeTimestamp() {
for (const index in files) {
@sorenlouv
sorenlouv / determine-changed-props.js
Last active April 18, 2024 16:21
Determine which props causes React components to re-render
import React, { Component } from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {
@wvteijlingen
wvteijlingen / index.js
Last active July 20, 2019 12:36
HOC for react-navigation that maps params to props
import paramsToProps from 'paramsToProps.js'
const MainNavigator = StackNavigator({
firstScreen: { screen: paramsToProps(FirstScreenComponent) },
secondScreen: { screen: paramsToProps(SecondScreenComponent) },
});
@zfael
zfael / nodejs.checksum.js
Created June 20, 2017 13:57
NODE.JS - How to generate file's Checksum (CRYPTO)
var fs = require('fs');
var crypto = require('crypto');
fs.readFile('file.pdf', function(err, data) {
var checksum = generateChecksum(data);
console.log(checksum);
});
function generateChecksum(str, algorithm, encoding) {
return crypto