Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mohammad H. Sattarian mhsattarian

🎯
Focusing
View GitHub Profile
View onetab-create-page-api.md
// API End-Point
http://www.one-tab.com/api/createPage

// POST Payload
{
  "key": "483e6ba2-08d6-4cb4-b167-550856f4d7c0",
  "tabGroups": [{
    "id": "aek6X7rnpxWCtUjcfcKTtw",
 "tabsMeta": [{
@psychemedia
psychemedia / SimpleAPI.ipynb
Created September 6, 2017 16:27
Demo of a simple API defining Jupyter notebook
View SimpleAPI.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View final-waveform.js
import React, { Component } from 'react';
import WaveSurfer from 'wavesurfer.js';
import { WaveformContianer, Wave, PlayButton } from './Waveform.styled';
class Waveform extends Component {
state = {
playing: false,
};
@crofty
crofty / index.html
Last active October 22, 2021 08:24
A example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
</head>
<body>
@also
also / wave.js
Created April 2, 2011 23:50
Generate WAVE file headers in JavaScript
View wave.js
// https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
function buildWaveHeader(opts) {
var numFrames = opts.numFrames;
var numChannels = opts.numChannels || 2;
var sampleRate = opts.sampleRate || 44100;
var bytesPerSample = opts.bytesPerSample || 2;
var blockAlign = numChannels * bytesPerSample;
var byteRate = sampleRate * blockAlign;
var dataSize = numFrames * blockAlign;
@lexruee
lexruee / bluetooth raspberry-pi
Created January 22, 2015 05:12
install bluetooth and pybluez
View bluetooth raspberry-pi
sudo apt-get update
sudo apt-get install python-pip python-dev ipython
sudo apt-get install bluetooth libbluetooth-dev
sudo pip install pybluez
@steveruizok
steveruizok / findSnapPoints.ts
Last active May 13, 2022 06:26
Find the snap points between a bounding box and several other bounding boxes.
View findSnapPoints.ts
interface TLBoundsWithCenter {
minX: number
midX: number
maxX: number
minY: number
midY: number
maxY: number
width: number
height: number
}
@MeTe-30
MeTe-30 / Convert Persian & English digits together
Created December 6, 2016 07:53
Convert Persian & English digits together | Javascript
View Convert Persian & English digits together
String.prototype.toPersianDigits = function () {
var id = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
return this.replace(/[0-9]/g, function (w) {
return id[+w];
});
};
String.prototype.toEnglishDigits = function () {
var id = { '۰': '0', '۱': '1', '۲': '2', '۳': '3', '۴': '4', '۵': '5', '۶': '6', '۷': '7', '۸': '8', '۹': '9' };
@marcus-at-localhost
marcus-at-localhost / 1info.md
Last active October 30, 2022 10:40
[JSON Path with Alpine CSP build in Postman Visualizer] Query JSON Response with JSON Path
View 1info.md

JSON Path with Alpine.js CSP build in Postman Visualizer

Query JSON Response with JSON Path

2022-04-30_13-58-39_2

To work more easily with Postman JSON results, I implemented JSONPath in a Postman Visualizer, to query the results.

JSONPath is to JSON what XPath is to XML, and it helps to dig into large nested objects and get what you are looking for faster.

First I was using just a jQuery version that can be found in the examples and that worked just fine. (JSONpath Visualizer | Postman Team Collections | Postman API Network)

@mort3za
mort3za / install-php5.6-ubuntu.sh
Last active November 24, 2022 08:03
Install php 5.6 and composer in ubuntu 18.04
View install-php5.6-ubuntu.sh
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
php --version
sudo apt-get install php5.6-curl php5.6-xml
sudo apt-get install composer