Skip to content

Instantly share code, notes, and snippets.

View synox's full-sized avatar

Aravindo Wingeier synox

View GitHub Profile
@domgiles
domgiles / OLED_merge.cpp
Created January 31, 2014 19:45
Support for Adafruit_CharacterOLED on the Spark Core. Merge of existing cpp and headers.
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
// OLED hardware versions
#define OLED_V1 0x01
#define OLED_V2 0x02
// commands
#define LCD_CLEARDISPLAY 0x01
@callil
callil / Sparkcore128x32i2c
Created July 4, 2014 01:54
Simple implementation of the sample script for the Adafruit 128x32 i2c OLED on the spark core. Based off this thread (https://community.spark.io/t/adafruit-ssd1306-library-ported/3505/48) and code from @pkourany (https://github.com/pkourany/Adafruit_SSD1306)
// This #include statement was automatically added by the Spark IDE.
#include "Adafruit_GFX.h"
// This #include statement was automatically added by the Spark IDE.
#include "Adafruit_SSD1306.h"
/*********************************************************************
This is an example for our Monochrome OLEDs based on SSD1306 drivers
@marioosh
marioosh / ChatRoom.scala
Last active March 1, 2020 08:11
websocket based on akka-http
class ChatRoom(roomId: Int, actorSystem: ActorSystem) {
private[this] val chatRoomActor = actorSystem.actorOf(Props(classOf[ChatRoomActor], roomId))
def websocketFlow(user: String): Flow[Message, Message, _] = ???
def sendMessage(message: ChatMessage): Unit = chatRoomActor ! message
}
@raviwu
raviwu / notes_soft_skills.md
Last active May 5, 2022 06:43
[Notes] Soft Skills: The software developer's life manual

Page 47

This kind of mindset is crucial to managing your career, because when you start to think of yourself as a business, you start to make good business decisions.

Page 52

Every step you take without a clear direction is a wasted step. Don’t randomly walk through life without a purpose for your career.

Your big goal should be something not too specific, but clear enough that you can know if you’re steering toward it or not. Think about what you want to ultimately do with your career.

#!/bin/sh
# mass deskew scanned files via command line
# - requires: ImageMagick and Deskew Tool
# - see http://galfar.vevb.net/wp/tag/deskew
for d in "$@"; do
file=`basename "$d" .pdf`
cd "`dirname "$d"`"
from scapy.all import *
import requests
import time
MAGIC_FORM_URL = 'http://put-your-url-here'
def record_poop():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
"Measurement": 'Poopy Diaper'
}
@dhruska
dhruska / add-all-amex-offers.js
Last active March 17, 2023 06:33
Script to automatically add all American Express offers
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function clickAllOffers () {
const offerButtons = Array.from(document.getElementsByClassName("offer-cta")).filter(btn => btn.title === "Add to Card" || btn.title === "Activate Offer");
for (const offerButton of offerButtons) {
console.log("Clicking offer button");
offerButton.click();
@adgedenkers
adgedenkers / vpn_connection.scpt
Created October 11, 2012 18:16
Toggle Connection to VPN on a Mac via AppleScript
tell application "System Events"
-- get current clipboard contents as a string
set CurrentClipboard to the clipboard as string
-- set the clipboad to your password
set the clipboard to "Y0urVPNPa$$w0rd"
-- start playing with the VPN
tell current location of network preferences
@twksos
twksos / CiscoVPNConnection.scpt
Last active July 31, 2023 20:50
Cisco VPN connection auto connect AppleScript
-- Please set your vpn connection name and password here
set VPNName to "VPN name"
set VPNpassword to "VPN password"
tell application "System Events"
tell current location of network preferences
set VPNService to service VPNName
end tell
set isConnected to connected of current configuration of VPNService
@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.