Skip to content

Instantly share code, notes, and snippets.

uploadImageCordova = function (callback, progressCallback, localPreviewCallback) {
var fail = function (error) {
callback(error);
};
var cameraSuccess = function (imageURI) {
if (_.isFunction(localPreviewCallback)) {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) {
// console.log('image URI');
@nate-strauser
nate-strauser / 0xbtc-hive.txt
Last active April 25, 2018 14:47
0xBitcoin Mining on HiveOS
#from hive console
stop all miners on rig
disable hashrate watchdog #don't want the last miner starting back up on it's own
#from terminal
ssh user@192.168.1.XXX #the local ip of the rig
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
Verifying that +natestrauser is my blockchain ID. https://onename.com/natestrauser
@nate-strauser
nate-strauser / Materialize CSS - Modal Fixed Header
Created May 18, 2016 19:49
How to have a fixed modal header with materializecss
Modal Markup:
<div class="modal modal-fixed-header">
<div class="modal-header">
HEADER CONTENT
</div>
<div class="modal-content">
MAIN CONTENT
</div>
</div>
echo $METEOR_TOKEN > deployment_token.json
echo $METEOR_SETTINGS > deployment_settings.json
DEPLOY_HOSTNAME=galaxy.meteor.com METEOR_SESSION_FILE=deployment_token.json meteor deploy $METEOR_TARGET --settings deployment_settings.json
{
"galaxy.meteor.com": {
"env": {
"ROOT_URL": "http://www.weworkmeteor.com",
"MONGO_URL": "mongodb://wework:PASSWORD@candidate.15.mongolayer.com:10058,candidate.14.mongolayer.com:10058/wework",
"MONGO_OPLOG_URL": "mongodb://wework:PASSWORD@candidate.15.mongolayer.com:10058,candidate.14.mongolayer.com:10058/local?authSource=wework",
"MAIL_URL": "smtp://postmaster@weworkmeteor.com:PASSWORD@smtp.mailgun.org:587"
}
},
"public": {
@nate-strauser
nate-strauser / gist:a1b23aa336894110ee6f
Created September 5, 2015 04:13
State machine example
var events = [
{ name: 'approve', from: 'pending', to: 'approved' },
{ name: 'reject', from: 'pending', to: 'rejected' },
{ name: 'fail', from: '*', to: 'failed' }
];
var callbacks = {
onapprove: function(event, from, to, order) {
var setObject = {
#!/usr/bin/python
# Connects to servers vulnerable to CVE-2014-0160 and looks for cookies, specifically user sessions.
# Michael Davis (mike.philip.davis@gmail.com)
# Based almost entirely on the quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import select
html>>>>
<select id="schoolSystem" name="system" placeholder="System" data-required="true" class="input-large" data-required-message="System is required">
<option></option>
{{#each systems}}
<option value="{{_id}}">{{name}}</option>
{{/each}}
</select>
Meteor.startup(function () {
if(!Meteor.roles.findOne({name: "admin"}))
Roles.createRole("admin");
if(!Meteor.roles.findOne({name: "baker"}))
Roles.createRole("baker");
if(Users.find().count() === 0){
log.info('no users detected, loading sample data');