Skip to content

Instantly share code, notes, and snippets.

@innocuo
innocuo / convert_key.sh
Created March 16, 2017 15:17
Convert PuTTY .ppk key to OpenSSH in Ubuntu
sudo apt-get install putty-tools
#private keys
puttygen your_private_key.ppk -O private-openssh -o your_new_key
chmod 600 your_new_key
#public keys
puttygen your_public_key.ppk -O public-openssh
#based on answer at superuser
@innocuo
innocuo / find_modified_files.sh
Created March 18, 2017 21:42
Files modified the last 7 days
find . -type f -mtime -7
@innocuo
innocuo / make_finder_faster.sh
Created March 18, 2017 21:46
make osx finder faster
#delete logs
sudo rm -rf /private/var/log/asl/*.asl
#and make it faster
rm ~/Library/Preferences/com.apple.finder.plist&&killall Finder
@innocuo
innocuo / notification.swift
Last active March 25, 2017 17:34 — forked from zachbrown-bm/notification.swift
Deliver an OSX notification with Swift
func showNotification(title : String, informativeText: String) -> Void {
let notification = NSUserNotification()
notification.identifier = "\(NSDate().timeIntervalSince1970)"
notification.title = title
notification.informativeText = informativeText
notification.soundName = NSUserNotificationDefaultSoundName
NSUserNotificationCenter.default.deliver(notification)
}
@innocuo
innocuo / StructExample.swift
Created March 29, 2017 02:11
Example of using Struct and extension
struct StructExample{
let text: String
let author: String
static let all: [Quote] = [
StructExample(text:"Enjoy the little things", author:"me"),
StructExample(text:"The best is yet to come", author:"you"),
StructExample(text:"No excuses", author:"she"),
StructExample(text:"The master has failed more times than the beginner has even tried", author:"he"),
StructExample(text:"One day can change everything", author:"not me"),
@innocuo
innocuo / readme.md
Created March 30, 2017 22:55
How to hide the dock icon in xcode for a osx app

Hiding the Dock Icon

  1. Open Info.plist
  2. Add a new key "Application is agent (UIElement)"
  3. set its value to YES
@innocuo
innocuo / theme.liquid
Created April 12, 2017 23:32
Shopify, if home (home page, index, frontpage)
{% if template == 'index' %}
{% endif %}
@innocuo
innocuo / analog_mic_draw.ino
Created May 17, 2018 04:11 — forked from ksasao/analog_mic_draw.ino
[M5Stack] mic input test (speaker noise suppressed) refer to https://gist.github.com/ksasao/485ffbccbf3c47ea9cb814d3484e85e0
#include <driver/adc.h>
#include <M5Stack.h>
const int _bufSize = 128;
int _buf[_bufSize]; // adc buffer for suppress speaker noise
int _pos = 0;
int _old = 0;
int _count = 0;
int _offset = 0;
@innocuo
innocuo / .bash_profile
Created July 9, 2018 16:40
Add this to .bash_profile to list all hosts from your .ssh/config file
#list all hosts in .ssh/config
#if you add an argument, it lists all hosts that contain that word
whatssh(){
if [[ $# -eq 0 ]]; then
grep -w -i "Host" ~/.ssh/config | sed 's/[Hh]ost//'
else
grep -i "^Host\s\+.*$1.*$" ~/.ssh/config | sed 's/[Hh]ost//'
fi
}
//p5 js example
function setup() {
createCanvas(200, 100);
frameRate(24);
}
let angle = 0;
let sin1 = 0;
let sin2 = 0;
let angle_inc = .2;