Skip to content

Instantly share code, notes, and snippets.

View Vec2.js
/*
Common vector operations
Author: Tudor Nita | cgrats.com
Version: 0.51
*/
function Vec2(x_,y_)
{
this.x = x_;
this.y = y_;
@jeantimex
jeantimex / parse-options.sh
Created Jul 31, 2020 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
View parse-options.sh
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@jeantimex
jeantimex / Vector2D.js
Created Jul 29, 2020 — forked from winduptoy/Vector2D.js
JavaScript 2D Vector Class
View Vector2D.js
/*
Simple 2D JavaScript Vector Class
Hacked from evanw's lightgl.js
https://github.com/evanw/lightgl.js/blob/master/src/vector.js
*/
function Vector(x, y) {
@jeantimex
jeantimex / iPod.swift
Created Jul 28, 2020 — forked from jordansinger/iPod.swift
Swift Playgrounds iPod Classic
View iPod.swift
import SwiftUI
import PlaygroundSupport
struct iPod: View {
var body: some View {
VStack(spacing: 40) {
Screen()
ClickWheel()
Spacer()
}
View rsync.md

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.

@jeantimex
jeantimex / webpack.config.js
Created Jun 19, 2020 — forked from ayastreb/webpack.config.js
Build Chrome Extension with React using Webpack
View webpack.config.js
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',
@jeantimex
jeantimex / background.js
Created Jun 10, 2020
Simple Chrome extension
View background.js
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')"});
View express
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 / .block
Last active Apr 26, 2020
Simple line chart with grid lines
View .block
license: mit
@jeantimex
jeantimex / .block
Last active Apr 25, 2020
A simple line chart
View .block
license: mit
You can’t perform that action at this time.