Skip to content

Instantly share code, notes, and snippets.

View ihatecsv's full-sized avatar
☢️
Totally tubular

Drake ihatecsv

☢️
Totally tubular
View GitHub Profile
<?php
header('Access-Control-Allow-Origin: *');
// was used when API address moved but apps were live on app store.
// create curl resource
$ch = curl_init();
error_log($_GET['m']);
// set url
curl_setopt($ch, CURLOPT_URL, "http://your.node.host:3000/sendmsg?m=" . $_GET['m']);
//This app requires the express and serialport libraries for node. You can get them on NPM with:
//npm install express
//npm install serialport
var app = require('express')();
var http = require('http').Server(app);
var SerialPort = require("serialport").SerialPort;
var serialPort = new SerialPort("COM3", { //change port to your Arduinos port
baudrate: 9600,
song = "";
setInterval(function() {
if (song != $('#track-name').find('a').text().replace(/ /g, "~") + '|' + $('#track-artist > a').text().replace(/ /g, "~")) {
song = $('#track-name').find('a').text().replace(/ /g, "~") + '|' + $('#track-artist > a').text().replace(/ /g, "~");
$.ajax({
//The URL to process the request
'url': 'https://your.webserver/relay.php?m=' + song,
'type': 'GET',
'success': function(data) {
if (data == "success") {
/*
LiquidCrystal Library - Serial Input
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch displays text sent over the serial port
(e.g. from the Serial Monitor) on an attached LCD.
@ihatecsv
ihatecsv / snip.java
Created December 31, 2015 02:08
mapChunk
@SubscribeEvent(priority=EventPriority.LOWEST)
public void onChunkLoad(ChunkEvent.Load event) {
int chunkX = event.getChunk().xPosition;
int chunkZ = event.getChunk().zPosition;
int cornerX = chunkX*16;
int cornerZ = chunkZ*16;
//System.out.println("chunk at " + chunkX + ", " + chunkZ + " getting loaded");
//System.out.println("Boundries at " + cornerX + ", " + cornerZ);
public boolean equals(RadChunk chunk){
if(this.x == chunk.x && this.z == chunk.z){
return true;
}
return false;
}
else{
System.out.println("Handled");
RadiationEventHandler.chunkList.put(chunk, new ArrayList<Point3D>());
int modCornerX = n*16;
int modCornerZ = m*16;
for(int i = modCornerX; i <= modCornerX+15; i++){
for(int k = modCornerZ; k <= modCornerZ+15; k++){
for(int j = 0; j <= 255; j++){
Block sourceBlock = player.worldObj.getBlock(i, j, k);
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
<VirtualHost *:80>
ServerName dev.dom1.com
Redirect permanent / https://dev.dom1.com/
</VirtualHost>
SSLCompression off
SSLProtocol All -SSLv2 -SSLv3
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLOpenSSLConfCmd DHParameters "/etc/ssl/certs/dhparam.pem"