Skip to content

Instantly share code, notes, and snippets.

View digideskio's full-sized avatar

airbender digideskio

View GitHub Profile
@digideskio
digideskio / AuthController.js
Created April 1, 2016 10:55 — forked from theangryangel/AuthController.js
sails (v0.8.82) + passport + passport-local Rough Example. For the love of all that is holy, don't use this in production.
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
@digideskio
digideskio / TestController.js
Created April 1, 2016 10:55 — forked from theangryangel/TestController.js
Abusing sails' policies to use existing express middleware (ie. express-form)
// api/controllers/TestController.js
var TestController = {
// since the policy will have run, we can now use req.form as "normal"
formtest: function(req, res)
{
if (!req.form.isValid)
{
// Handle errors
@digideskio
digideskio / csv_import_magic.js
Created April 5, 2016 13:03 — forked from ianlewis/csv_import_magic.js
A Google Apps Script for importing CSV data into a Google Spreadsheet.
// vim: ft=javascript:
/*jslint sloppy: true, vars: true, white: true, nomen: true, browser: true */
/*global SpreadsheetApp, UiApp, UrlFetchApp, Utilities */
/*
* A script to automate requesting data from an external url that outputs CSV data.
*
* Adapted from the Google Analytics Report Automation (magic) script.
* @author nickski15@gmail.com (Nick Mihailovski)
* @author ianmlewis@gmail.com (Ian Lewis)
*/
@digideskio
digideskio / imagemagick-install-steps
Created April 16, 2016 14:42 — forked from rodleviton/imagemagick-install-steps
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
@digideskio
digideskio / brunch-heroku-deploy.md
Created April 20, 2016 04:09
Build & deploy brunch applications on Heroku.
  1. Add to .gitignore:

    node_modules
    public
    
  2. Add to your app dependencies of package.json:

@digideskio
digideskio / magento-reset-dashboard.sql
Created April 20, 2016 10:12 — forked from mystix/magento-reset-dashboard.sql
Magento: reset dashboard data
SET foreign_key_checks = 0;
-- Last 5 Search Terms / Top 5 Search Terms
TRUNCATE TABLE catalogsearch_fulltext;
TRUNCATE TABLE catalogsearch_query;
TRUNCATE TABLE catalogsearch_result;
-- Dashboard stats (e.g. "Most Viewed Products" etc)
TRUNCATE TABLE report_compared_product_index;
TRUNCATE TABLE report_event;
@digideskio
digideskio / install.sh
Created April 20, 2016 22:38 — forked from mbmccormick/install.sh
logmein-hamachi-2.1.0.119-armhf
#!/bin/sh
HAMACHI_DST=/opt/logmein-hamachi
if [ -x /opt/logmein-hamachi/uninstall.sh ] ; then
echo Removing previous version ..
/opt/logmein-hamachi/uninstall.sh
fi
echo Copying files into $HAMACHI_DST ..
function whois_query($domain) {
// fix the domain name:
$domain = strtolower(trim($domain));
$domain = preg_replace('/^http:\/\//i', '', $domain);
$domain = preg_replace('/^www\./i', '', $domain);
$domain = explode('/', $domain);
$domain = trim($domain[0]);
// split the TLD from domain name
@digideskio
digideskio / eduroam-wifi
Created April 23, 2016 04:10 — forked from ShivamMistry/eduroam-wifi
Wireless eduroam netctl config for University of York
Description='Eduroam York'
Interface=wlp4s0
Connection=wireless
Security=wpa-configsection
IP=dhcp
Priority=1
ESSID=eduroam
WPAConfigSection=(
'ssid="eduroam"'
'key_mgmt=WPA-EAP'
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __FILE__)
require 'bundler/setup'
require 'dbus'
class Wicd
NOT_CONNECTED = 0
CONNECTING = 1
WIRELESS = 2
WIRED = 3