Skip to content

Instantly share code, notes, and snippets.

View mriveralee's full-sized avatar

Michael Rivera mriveralee

View GitHub Profile
@amandaghassaei
amandaghassaei / golden_angle_animation.md
Last active January 3, 2024 01:11
Golden Angle Animation using ffmpeg

Golden Angle Animation using ffmpeg

Update: I've turned this into a web app!

This is a single line command to generate a "golden angle" animation by rotating an image in increments of 137.5 degrees. Try this out on images of pinecones, succulents, flowers, fruits, and vegetables – anything that exhibits fibonacci spirals. I'll post some examples in the comments below.

I came across this idea while reading about the artist John Edmark, who creates hypnotizing zoetrope sculptures. He said in an interview that you could take a pineapple or pinecone and put it on a turntable with a strobe light for the same effect, and I wanted to test it out.

Steps To Use:

@PavithMadusara
PavithMadusara / electron-react-serialport.md
Last active March 19, 2023 16:01
Electron Application with Node Serial Port and React

npm create electron-app app-name --template=webpack

Install Node Serial

npm install serialport npm i -D electron-rebuild

Add this to package.json scrips

"install":"electron-rebuild"

@vlasky
vlasky / point_in_polygon_using_winding_number.js
Last active March 19, 2024 04:58
JavaScript implementation of winding number algorithm to determine whether a point is inside a polygon
//JavaScript implementation of winding number algorithm to determine whether a point is inside a polygon
//Based on C++ implementation of wn_PnPoly() published on http://geomalgorithms.com/a03-_inclusion.html
function pointInPolygon(point, vs) {
const x = point[0], y = point[1];
let wn = 0;
for (let i = 0, j = vs.length - 1; i < vs.length; j = i++) {
let xi = vs[i][0], yi = vs[i][1];
let xj = vs[j][0], yj = vs[j][1];
@nesquena
nesquena / CursorRecyclerAdapter.java
Created April 3, 2017 07:13
Cursor Adapters for RecyclerView
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 ARNAUD FRUGIER
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@0xjac
0xjac / private_fork.md
Last active May 22, 2024 11:28
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@perrygeo
perrygeo / base64_padding.md
Last active October 25, 2023 16:20
Avoiding TypeError: Incorrect padding with Python's base64 encoding

Avoiding padding errors with Python's base64 encoding

>>> import base64
>>> data = '{"u": "test"}'
>>> code = base64.b64encode(data)
>>> code
'eyJ1IjogInRlc3QifQ=='
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@mattt
mattt / nshipster-new-years-2015.md
Created November 25, 2014 19:38
NSHipster New Year's 2015

Season's Greetings, NSHipsters!

As the year winds down, and we take a moment to reflect on our experiences over the past months, one thing is clear: 2014 has been an incredible year professionally for Apple developers. So much has happened in such a short timespan, and yet it's hard to remember our relationship to Objective-C before Swift, or what APIs could have captivated our imagination as much as iOS 8 or WatchKit.

It's an NSHipster tradition to ask you, dear readers, to send in your favorite tips and tricks from the past year for publication over the New Year's holiday. This year, with the deluge of new developments—both from Cupertino and the community at large—there should be no shortage of interesting tidbits to share.

Submit your favorite piece of Swift or Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!

If you're wondering about what to post, look to

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 19, 2024 17:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@zupo
zupo / folder_splitter.py
Created June 24, 2013 12:56
Split a folder with many files into subfolders with N files. Usage: python folder_splitter.py path/to/target/folder
# -*- coding: utf-8 -*-
# @author: Peter Lamut
import argparse
import os
import shutil
N = 10 # the number of files in seach subfolder folder