Skip to content

Instantly share code, notes, and snippets.

View iksnae's full-sized avatar

K Mills iksnae

View GitHub Profile
@ayee
ayee / InstallOpenCViOS.md
Last active January 25, 2021 23:21
How to Install opencv for iOS on OSX
  1. Install cmake
  2. Add to cmake to PATH
PATH=$PATH:/Applications/CMake.app/Contents/bin
  1. Clone OpenCV repository
cd ~/<my_working _directory>
git clone https://github.com/opencv/opencv.git
@EQuimper
EQuimper / clear.txt
Created June 16, 2017 16:17
React-Native clear Watchman + Cache
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache
@andkirby
andkirby / slack.sh
Last active September 18, 2025 15:26
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
@profjsb
profjsb / generate_df_lambda_package.sh
Created June 22, 2017 13:51
Serverless Distributed Decision Forests with AWS Lambda
# build the environment ... this will take awhile
docker run -v $(pwd):/outputs -it amazonlinux:2016.09 /bin/bash /outputs/build.sh
# should end with something like "venv compressed size 51M"
# unpackage that environment
unzip venv.zip -d ve_package/
@mminer
mminer / MyService.swift
Last active April 23, 2024 23:00
Components of XPC service.
import Foundation
class MyService: NSObject, MyServiceProtocol {
func upperCaseString(_ string: String, withReply reply: @escaping (String) -> Void) {
let response = string.uppercased()
reply(response)
}
}
@OhTerryTorres
OhTerryTorres / SpriteKitLevelsByJSON.md
Last active July 14, 2023 15:16
Creating levels for a SpriteKit game using JSON

Making Levels in a SpriteKit game from JSON

I’m making a SpriteKit game for a wine shop in Boston’s North End. We want it to

  1. have an old-school, chunky, arcadey hack-and-slash feel
  2. properly convey that old-school feel using effortless touch controls
  3. have its levels built (and potentially updated after launch) using an external data file

I want to talk about how I plan on implementing that last one: level data from an external file.

import Darwin.C
let zero = Int8(0)
let transportLayerType = SOCK_STREAM // TCP
let internetLayerProtocol = AF_INET // IPv4
let sock = socket(internetLayerProtocol, Int32(transportLayerType), 0)
let portNumber = UInt16(4000)
let socklen = UInt8(socklen_t(MemoryLayout<sockaddr_in>.size))
var serveraddr = sockaddr_in()
serveraddr.sin_family = sa_family_t(AF_INET)
serveraddr.sin_port = in_port_t((portNumber << 8) + (portNumber >> 8))
@miguelmota
miguelmota / webdriver_full_page_screenshots.js
Last active October 13, 2025 01:08
Selenium Webdriver Node.js take screenshots of entire page
var webdriver = require('selenium-webdriver')
var assert = require('assert')
var fs = require('fs')
// Input capabilities
var capabilities = {
'browserName' : 'Chrome',
'browser_version' : '66.0',
'os' : 'Windows',
'os_version' : '10',
@Sorix
Sorix / Package.swift
Last active April 8, 2025 05:41
Example of Package.swift with environment variables support
// swift-tools-version:4.0
import PackageDescription
#if os(Linux)
import Glibc
#else
import Darwin.C
#endif
enum Enviroment: String {
@codecitizen
codecitizen / serverless.yml
Created November 22, 2018 20:42
A serverless.yml file configuring a AWS ElastiCache redis instance that is accessible by all AWS Lambda functions deployed by this serverless function.
service: my-service
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage, 'dev'}
environment:
REDIS_HOST:
"Fn::GetAtt": [ElasticCacheCluster, RedisEndpoint.Address]
functions: