Skip to content

Instantly share code, notes, and snippets.

View kingcody's full-sized avatar

Cody Mize kingcody

  • Digitally Seamless
View GitHub Profile
@kingcody
kingcody / socket.service.js
Last active July 8, 2022 04:06
socket.io service for angular-fullstack
/* global io */
'use strict';
angular.module('testFullstackApp')
.factory('socket', function(socketFactory) {
// socket.io now auto-configures its connection when we ommit a connection url
var ioSocket = io('', {
// Send auth token on connection, you will need to DI the Auth service above
// 'query': 'token=' + Auth.getToken()
@kingcody
kingcody / teensyduino.sh
Created December 11, 2018 07:34
Update teensyduino.sh PID Detection
#!/bin/bash
sleep 2
export HOME=$2
$1 & TEENSYPID=$!
sleep 5
xdotool search --class "teensyduino" \
windowfocus \
@kingcody
kingcody / admin.controller.es6
Last active October 27, 2016 14:52
Angular Fullstack - delete confirmation modal example
'use strict';
(function() {
class AdminController {
constructor(User, Modal) {
// Use the User $resource to fetch all users
this.users = User.query();
// Our callback function is called if/when the delete modal is confirmed
@kingcody
kingcody / test-file-creation.js
Created September 6, 2014 02:06
angular-fullstack testing
/*global describe, beforeEach, it */
'use strict';
var path = require('path');
var helpers = require('yeoman-generator').test;
var chai = require('chai');
var expect = chai.expect;
var fs = require('fs-extra');
var exec = require('child_process').exec;
describe('angular-fullstack generator', function () {
// Custom user-defined rules for polkit
//
// See the polkit(8) man page for more information
// about configuring polkit.
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.login1.suspend" ||
action.id == "org.freedesktop.login1.suspend-multiple-sessions" ||
action.id == "org.freedesktop.login1.hibernate" ||
action.id == "org.freedesktop.login1.hibernate-multiple-sessions" ||
@kingcody
kingcody / PKGBUILD
Created November 13, 2013 08:24 — forked from detrohutt/PKGBUILD
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
pkgname=udns
pkgver=0.2
pkgrel=1
pkgdesc='Stub DNS resolver library with ability to perform both syncronous and asyncronous DNS queries'
url='http://www.corpit.ru/mjt/udns.html'
license=('LGPL')
arch=('i686' 'x86_64' 'armv6h')
@kingcody
kingcody / toCamelCase
Last active December 25, 2015 22:39
extend js string object to include toCamelCase method
// string.toCamelCase()
if (!String.prototype.toCamelCase) {
String.prototype.toCamelCase = function toCamelCase() {
return this.toLowerCase().replace(/(\-[a-zA-Z])/g, function($1) {
return $1.toUpperCase().replace('-','');
})
};
}
@kingcody
kingcody / gist:7051224
Last active December 25, 2015 22:39 — forked from detrohutt/gist:7051206
extends layout
block content
.container
#accordion.panel-group
- for (var i = 0; i < serviceList.length; i++)
.panel.panel-default
.panel-heading
h4.panel-title
a.accordion-toggle(data-toggle='collapse', data-parent='#accordion', href='#'+serviceList[i].name)=serviceList[i].name
@kingcody
kingcody / activeClassing.patch
Last active December 25, 2015 03:59
Active Classing Patch to routes/index.js
unchanged:
--- b/routes/index.js
+++ b/routes/index.js
@@ -4,6 +4,13 @@
var merge = require('merge'),
fs = require('fs');
+// Returns a camel cased version of input
+var camelCase = function camelCase(input) {
+ return input.toLowerCase().replace(/-(.)/g, function(match, group1) {
@kingcody
kingcody / PKGBUILD
Created June 29, 2013 04:34
Pianobarfly PKGBUILD(ABS) for ghuntly/pianobarfly realease: 20130628
# Contributor: Cyker Way <cykerway at gmail dot com>
pkgname=pianobarfly-git
pkgver=20130628
pkgrel=1
pkgdesc="A console client for the personalized web radio pandora"
url="http://www.ghuntley.com/"
arch=('i686' 'x86_64')
license=('MIT')
depends=('libao' 'faad2' 'libmad' 'readline')
optdepends=('libmad')