This gist is deprecated and will not be edited in the future. Consider visit ninedraft/python-udp repo. It will not be deleted, however.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Facades\View; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\View\Factory as ViewFactory; | |
class AppServiceProvider extends ServiceProvider | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import request | |
import json | |
import requests | |
import hashlib as hasher | |
import datetime as date | |
node = Flask(__name__) | |
# Define what a Snakecoin block is | |
class Block: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'label' => '', // Text in Label | |
'class' => '', | |
'style' => '', | |
'wrapper_class' => '', | |
'value' => '', // if empty, retrieved from post meta where id is the meta_key | |
'id' => '', // required | |
'name' => '', //name will set from id if empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HID = require('node-hid'), | |
usb = require('usb'); | |
var reading = false, | |
interval, | |
vid = 0x922, | |
pid = 0x8003; | |
// try to connect to the scale if available | |
startReading(); |
I wanted Octoprint (a 3D-printer management software) to start up fast without the bloatness of using Raspbian. I also regularly forgot to shutdown the Raspberry Pi hosting Octoprint properly leading to file system corruption and unbootable SD card.
This set of instructions should provide all that is needed to use Octoprint without fear of improper shutdown with Arch Linux ARM by using a read-only file system.
This instructions does not have the webcam setup as I didn't intend to use it. If you wish to use the webcam, please consult and try to port the official Raspbian FAQ.
##Instructions
- Convert the Arch Linux ARM file system to read-only. Please follow the instructions from my previous gist. The following instructions assume you are logged into with the root account.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#ZPL docs can be found at https://support.zebra.com/cpws/docs/zpl/zpl_manual.pdf | |
#This works with Python 3, change the bytes to str if you are using Python 2 | |
import socket | |
#One easy way to find the IP address is with this nmap command | |
# nmap 192.168.0.* -p T:9100 --open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//given the urls of files to download, store them on the filesystem | |
function download_all_files (urls, base_destination, job_id, cb) { | |
var url = urls.shift(); | |
var file_path = path.join(base_destination, job_id); | |
// the path to the file without the filename | |
var path_to_file_folder = path.dirname(file_path); | |
// the method to store a downloaded file to the fs | |
// makes an http request and writes the response to a file |
Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
NewerOlder