Skip to content

Instantly share code, notes, and snippets.

@jeantimex
jeantimex / SwiftyLib.podspec
Last active February 24, 2019 23:53
SwiftyLib.podspec
Pod::Spec.new do |spec|
spec.name = "SwiftyLib"
spec.version = "0.0.1"
spec.summary = "A CocoaPods library written in Swift"
spec.description = <<-DESC
This CocoaPods library helps you perform calculation.
DESC
@jeantimex
jeantimex / Three-Dimensional-BFS.js
Created March 15, 2019 06:42
Three-Dimensional BFS
/**
* @param {string[][]} maze
* @param {number[]} px
* @param {number} k
*/
const shortestPath = (maze, px, k) => {
const dx = [-1, 1, 0, 0];
const dy = [0, 0, -1, 1];
const m = maze.length;
@jeantimex
jeantimex / actionlist.vim
Created February 24, 2020 22:01 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@jeantimex
jeantimex / .block
Last active April 25, 2020 23:03
How to draw a us map
license: mit
@jeantimex
jeantimex / .block
Last active April 25, 2020 23:21
A simple line chart
license: mit
@jeantimex
jeantimex / .block
Last active April 26, 2020 23:46
Simple line chart with grid lines
license: mit
const express = require('express');
const app = express();
app.use(express.static('public'));
app.get('/', (req, res) => {
res.send('An alligator approaches!');
});
app.listen(3000, () => console.log('Gator app listening on port 3000!'));
@jeantimex
jeantimex / background.js
Created June 10, 2020 06:58
Simple Chrome extension
var toggle = false;
chrome.browserAction.onClicked.addListener(function (tab) {
toggle = !toggle;
if (toggle){
// chrome.browserAction.setIcon({path: "on.png", tabId:tab.id});
chrome.tabs.executeScript(tab.id, {file: "color-picker.js"});
} else {
//chrome.browserAction.setIcon({path: "off.png", tabId:tab.id});
//chrome.tabs.executeScript(tab.id, {code: "alert('hello')"});
@jeantimex
jeantimex / webpack.config.js
Created June 19, 2020 15:08 — forked from ayastreb/webpack.config.js
Build Chrome Extension with React using Webpack
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
// Entry files for our popup and background pages
entry: {
popup: './src/popup.js',

From https://www.silentorbit.com/notes/2013/rsync-by-extension/

Having a file structure full of various file types you want to sync only files of one type into a new location.

rsync -rv --include '*/' --include '*.js' --exclude '*' --prune-empty-dirs Source/ Target/

This will generate the same structure found in Source into Target but only including the JavaScript(.js) files.