Skip to content

Instantly share code, notes, and snippets.

@gskielian
gskielian / watchdog.sh
Created April 8, 2018 19:16
Forever Start @reboot
#!/bin/bash
# usage, replace the <path to app.js file> with full path to your node app
# set crontab to @reboot <full path to this script>
# make sure to chmod +x this script to make it runnable
export PATH=/usr/local/bin:$PATH
if [ `/usr/local/bin/forever list | /usr/bin/wc -l` -le 1 ]; then
/usr/local/bin/forever start <path to app.js file>
fi
@gskielian
gskielian / .gitignore
Created April 1, 2018 20:40
Altium Gitignore
# feel free to pull request
*.PCBDoc.htm
*.PCBDocPreview
*.PrjPrbStructure
*.SchDocPreview
*.SchDotPreview
*.cmp
*.swp
History
Project Logs*
@gskielian
gskielian / ledCode.ino
Created October 20, 2015 22:36
led Code from Rock GServe event
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
you connect the leds to
pin 13 and gnd
connect another to
pin 3, pin 4
@gskielian
gskielian / kieltime.sh
Last active August 29, 2015 14:14
pomodoro-like shell script for time management (beeps and does a cowsay to indicate when it's finished)
#!/bin/bash
#check if numeric
is_numeric() {
if [ "$1" -eq "$1" ] 2> /dev/null; then
return 0
else
echo "Error, time input \"$1\" not int, see -h for help" | cowsay -f tux
exit 1
fi
@gskielian
gskielian / gist:59867020438ce7a26dc2
Created October 15, 2014 18:00
add to vimrc to save folds
au BufWinLeave ?* mkview
au BufWinEnter ?* silent loadview
@gskielian
gskielian / git-specify-ssh-key
Created October 14, 2014 16:51
Specifying SSH Key within Git Clone
#how to specify an ssh key to use when cloning a repo in Mac
ssh-agent bash -c 'ssh-add /Users/UR_USERNAME/.ssh/UR_PRIVATE_KEY; git clone git@DAS_GIT_URL'
package com.example.a1_awesome_intents;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
@gskielian
gskielian / gist:824f9037a7ba087bb82e
Created August 17, 2014 19:25
Hello World: Button-TextView Update Android : )
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button doStuffButton = (Button) findViewById(R.id.do_stuff_button);
TextView myTextView = (TextView) findViewById(R.id.textView1);
//remember lowerCamelCase for buttons
doStuffButton.setOnClickListener(new View.OnClickListener() {
//here we send the user to the next activity
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class SwingHelloWorld extends JFrame{
public static void main(String[] args){
SwingHelloWorld frame = new SwingHelloWorld("Hello");
frame.setSize(500,500);
frame.setVisible(true);
char ch;
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available()) {