Skip to content

Instantly share code, notes, and snippets.

View codenuke's full-sized avatar

C0deNuke codenuke

View GitHub Profile
@codenuke
codenuke / slam_filter_motor.py
Last active December 29, 2015 05:29
Homework of FRA638 (Mobile Robotics)
from math import sin, cos, pi
from lego_robot import *
from pylab import *
# This function takes the old (x, y, heading) pose and the motor ticks
# (ticks_left, ticks_right) and returns the new (x, y, heading).
def filter_step(old_pose, motor_ticks, ticks_to_mm, robot_width,
scanner_displacement):
r = motor_ticks[1] * ticks_to_mm
@codenuke
codenuke / dropbox_auto_start
Created March 9, 2014 15:21
Dropbox Auto Start
#!/bin/sh
# dropbox service
# Replace with space delimited linux users you want to run Dropbox clients for
DROPBOX_USERS="user1 user2"
DAEMON=.dropbox-dist/dropbox
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
<?php
$ldap_host='your_host';
$ldap_user='your_user';
$ldap_pass='your_password';
$ldap_rdn = 'uid='.$ldap_user;
echo "LDAP Connecting ... <br>";
if ( $conn = ldap_connect( $ldap_host) )
@codenuke
codenuke / path_mcrypt.bash
Created May 15, 2014 09:14
Fix requires the Mcrypt PHP extension.
# Step 1
cd ~
# Step 2
vi .bash_profile
# Step 3 : Insert this line and chage php path.
export PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH
# Step 4 Save File => :wq
public void TestApi()
{
string url = "https://api.github.com/repos/Svl2Nuk3/jtable";
var client = new RestClient(url);
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
var content = response.Content;
Console.WriteLine(content.ToString());
}
@codenuke
codenuke / kinematics_template.cs
Created May 20, 2014 06:08
Kinematics Template
public void ScaraForward(double j1,double j2 ,double j3 )
{
double x;
double y;
double z;
// Convert joint value to postion
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/theme product.css">
<link rel="stylesheet" type="text/css" href="css/cssmenu.css">
<link rel="stylesheet" type="text/css" href="css/work.css">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/theme product.css">
<link rel="stylesheet" type="text/css" href="css/cssmenu.css">
<link rel="stylesheet" type="text/css" href="css/work.css">
@codenuke
codenuke / find_day_of_week.php
Last active August 29, 2015 14:04
Find day of week in date range.
<?php
$start_date = new DateTime('2014-07-01'); // Create Start Date
$end_date = new DateTime('2014-07-31'); // Create End Date
$interval = DateInterval::createFromDateString('1 day');
$period = new DatePeriod($start_date , $interval, $end_date);
$day_of_week = array();
foreach ($period as $dt)
{
$day_of_week[] = $dt->format("N");
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}