Skip to content

Instantly share code, notes, and snippets.

View ronihcohen's full-sized avatar
🎯
Focusing

Rony HaCohen ronihcohen

🎯
Focusing
View GitHub Profile
@ronihcohen
ronihcohen / DS3231_MD_MAX72xx.ino
Last active June 29, 2024 06:02
Data from DS3231 displayed on 4 MAX7219
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include <DS3231.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 16
#define NUM_ZONES 4
#define CLK_PIN 13
# https://raspberrytips.nl/tm1637-4-digit-led-display-raspberry-pi/
import sys
import os
import time
import RPi.GPIO as IO
IO.setwarnings(False)
IO.setmode(IO.BCM)
import React from "react"
import {
useTable,
useSortBy,
useGlobalFilter,
useAsyncDebounce,
} from "react-table"
function Table({ columns, data }) {
// Define a default UI for filtering
name: github pages
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * 0'
jobs:
function sym() {
var args = Array.prototype.slice.call(arguments);
var flattened;
if (args.length>1){
flattened = args.reduce(function(previousValue, currentValue) {
var pre = clearIntersection (previousValue,true);
var cur = clearIntersection (currentValue,true);
function pairwise(arr, arg) {
var markerArr = [];
for (i=0;i<=arr.length-1;i++){
for (x=i+1;x<=arr.length-1;x++){
if ( !markerArr[x] && !markerArr[i]){
if (arr[x]+arr[i]==arg){
markerArr[x] = markerArr[i]= true;
}
}
@ronihcohen
ronihcohen / gist:42cacf51d391b0bbccd7
Created June 1, 2015 13:30
google maps distance widget
/**
* A distance widget that will display a circle that can be resized and will
* provide the radius in km.
*
* @param {google.maps.Map} map The map on which to attach the distance widget.
*
* @constructor
*/
var NorthEast = new google.maps.LatLng(
DefaultMapLocation.NorthEast.Latitude,
DefaultMapLocation.NorthEast.Longitude
);
var SouthWest = new google.maps.LatLng(
DefaultMapLocation.SouthWest.Latitude,
DefaultMapLocation.SouthWest.Longitude
);
var bounds = new google.maps.LatLngBounds();
@ronihcohen
ronihcohen / gist:add2a0a05ad113c43c35
Created April 5, 2015 15:30
Angular google maps distance widget directive.
'use strict';
/**
* @ngdoc directive
* @name directive:distanceWidget
* @description
* # distanceWidget for angular-google-maps
*/
angular.module('app')
.directive('distanceWidget', function (uiGmapIsReady, $filter) {
@ronihcohen
ronihcohen / gist:1241dcc6ab14351b6f41
Created July 13, 2014 12:48
angular-controller-as.html
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body ng-app="playground">