Skip to content

Instantly share code, notes, and snippets.

View jimf99's full-sized avatar
💭
I may be slow to respond.

JimFyyc jimf99

💭
I may be slow to respond.
  • -na-
  • YYC = Calgary Alberta Canada airport code
View GitHub Profile
/*! https://bitbucket.org/magnobiet/socialize.js */
function _socialize() {
$(window).on('scroll', function() {
if ($(window).scrollTop() >= $('#social').position().top - 100) {
SOCIALIZE.get.twitter();
SOCIALIZE.get.facebook();
@aksakalli
aksakalli / _example_ng-file-upload.md
Last active October 28, 2018 09:51
ng-file-upload example with NodeJS

ng-file-upload example with NodeJS

index.html should be in public folder in the same directory with app.js.

# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
@ShawnHymel
ShawnHymel / micro_bit_01_hello.py
Created August 11, 2016 00:43
Make the micro:bit scroll the phrase "Hello!"
from microbit import *
while True:
display.scroll("Hello!")
@chrisveness
chrisveness / crypto-aes-gcm.js
Last active January 8, 2026 19:38
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@PhirePhly
PhirePhly / YTChanViewCounter.ino
Created June 25, 2017 20:25
YouTube API to MAX7219 display Widget
// YouTube Channel View Counter
// Kenneth Finnegan, 2017
//
// Given a WiFi SSID + password, and YouTube API key + channel ID, displays the
// current total views count on an attached MAX7219 eight digit display
#include <YoutubeApi.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
@prasanthj
prasanthj / lirc-pi3.txt
Last active February 19, 2025 18:32
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
@aerrity
aerrity / client.js
Last active November 22, 2025 19:33
Node, Express & MongoDB: Button click example
console.log('Client-side code running');
const button = document.getElementById('myButton');
button.addEventListener('click', function(e) {
console.log('button was clicked');
fetch('/clicked', {method: 'POST'})
.then(function(response) {
if(response.ok) {
console.log('click was recorded');
@laemmy
laemmy / maidenhead.py
Created January 21, 2018 11:51
Convert latitude and longitude to Maidenhead grid locators.
# -*- coding: utf-8 -*-
import sys
# Convert latitude and longitude to Maidenhead grid locators.
#
# Arguments are in signed decimal latitude and longitude. For example,
# the location of my QTH Palo Alto, CA is: 37.429167, -122.138056 or
# in degrees, minutes, and seconds: 37° 24' 49" N 122° 6' 26" W
#
@MarcoCiaramella
MarcoCiaramella / UDP.java
Last active April 22, 2023 13:07
UDP sender and receiver for Android.
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;