Skip to content

Instantly share code, notes, and snippets.

View dansku's full-sized avatar
🌮
Focusing on tacos

Daniel Andrade dansku

🌮
Focusing on tacos
View GitHub Profile
@dansku
dansku / clickpocalypse_full-screen.js
Last active December 31, 2017 03:26
Clickpocalypse 2 full-screen tampermonkey
// ==UserScript==
// @name Clickpocalypse 2 Screensaver
// @namespace https://www.danielandrade.net
// @version 0.1
// @description Turn this game into a full-screen screensaver
// @author Daniel Spillere Andrade
// @match http://minmaxia.com/c2/
// ==/UserScript==
function addGlobalStyle(css) {
@dansku
dansku / SimpleAuthServer.py
Created December 15, 2017 13:10 — forked from fxsjy/SimpleAuthServer.py
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
@dansku
dansku / fixPicOrder.sh
Created October 30, 2017 02:54
fix pictures order by exif
jhead -nf%Y-%m-%d_%H-%M-%S *.jpg; X=1; for i in *.jpg; do mv $i $(printf %04d.%s ${X%.*} ${i##*.}); let X="$X+1";done
@dansku
dansku / greenshot.bat
Last active May 1, 2017 22:13
bat file to upload screenshot
echo http://yourdomain.net/shots/%~n1%~x1 | clip.exe
"C:\Windows\ncftpput.exe" -u USER -p PASSWORD SERVER "/yourdomain.net/shots" %1
@dansku
dansku / PCB Checklist.md
Last active March 29, 2017 16:15
Quick list of items to check when developing a PCB

Design and Schematic

General

  • Is the design passively or actively safe? For example, if an MCU or FPGA is being programmed, held in reset, or in their POR, does the circuit enter a safe / idle / known state? Is the circuit only hot under control (can it be)?
  • Can you detect all relevant environmental changes? If changes in environment indicate a change in operating state or mode, can you detect them? (e.g. VBUS high on a self-powered USB device, SD card in socket, a particular connector plugged in)
  • FETs have pull-ups / -downs?
  • BJTs properly biased for both levels and current?
  • Chip selects have pull-ups / -downs?
  • Pull-up / -down resistors appropriate value for expected environment/noise?
  • Enable pins checked for polarity. Not all datasheets indicate this well, pin description text checked? Part number verified for ICs with orderable polarity configurations?
@dansku
dansku / coin.py
Created March 16, 2017 16:06
Bitcoin & Ethereum Price
import urllib, json
from time import gmtime, strftime, sleep
import os
def getPrice(url):
response = urllib.urlopen(url)
data = json.loads(response.read())
return data
eth = "https://coinmarketcap-nexuist.rhcloud.com/api/eth"
@dansku
dansku / Manufacturing Acronym
Last active March 15, 2017 14:39
Quick reminder of all the thousand acronym out there
* MFG - Manufacturing
* MFD - Manufactured
* RFQ - Request for Quote Process
* LOA - Letter of Authorization
* RFO - Request for Order
* MPN - Manufacturer Part Number
@dansku
dansku / countdown.py
Created March 8, 2017 22:50
Display a countdown for the numbers of the day until a certain date
#calculate time differnece
import time
import os
while True:
now = time.time() #1488997525
end = 1517504400
difference = end - now
@dansku
dansku / countdown.py
Created March 8, 2017 22:50
Display a countdown for the numbers of the day until a certain date
#calculate time differnece
import time
import os
while True:
now = time.time() #1488997525
end = 1517504400
difference = end - now
/*
Daniel Andrade - www.danielandrade.net
non blocking classes for NewPing sonars
*/
#include <NewPing.h>
class Sonar : public NewPing
{
// Class Member Variables