Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
...

Ladislas de Toldi ladislas

💭
...
View GitHub Profile
View Homebrew Uninstall
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@ladislas
ladislas / Homebrew usr-local
Last active Dec 16, 2015
make /usr/local writable for hombrew
View Homebrew usr-local
$ sudo chgrp -R admin /usr/local
$ sudo chmod -R g+rwx /usr/local
$ sudo chmod -R o-w /usr/local
@ladislas
ladislas / Serial.read_to_string
Created Jun 11, 2013
an easy way to convert Serial.read() to string.
View Serial.read_to_string
// Buffer to store incoming commands from serial port
String inData;
void setup() {
Serial.begin(9600);
Serial.println("Serial conection started, waiting for instructions...");
}
void loop() {
while (Serial.available() > 0)
@ladislas
ladislas / Makefile up one folder
Created Jun 18, 2013
get the up one level folder in which the makefile is.
View Makefile up one folder
$(subst $(notdir ${CURDIR}),,${CURDIR})
View Sublimetext_Dropbox
ln -s ~/Dropbox/dev/app-data/sublime-imac/Installed\ Packages ./Installed\ Packages
ln -s ~/Dropbox/dev/app-data/sublime-imac/Packages ./Packages
ln -s ~/Dropbox/dev/app-data/sublime-imac/Pristine\ Packages ./Pristine\ Packages
@ladislas
ladislas / Basename_Curdi
Created Jun 20, 2013
get only the name of the current directory
View Basename_Curdi
$(shell basename $(CURDIR))
View moti.sublime-project
{
"folders":
[
{
"path": "/Users/Ladislas/dev/leka/moti"
}
],
"settings":
{
@ladislas
ladislas / serialPi.js
Created Jul 16, 2013
send serial command to arduino using node js
View serialPi.js
var serialport = require("serialport"),
SerialPort = serialport.SerialPort,
myPort;
var Fiber = require('fibers');
// Delay function using fibers
function sleep(ms) {
var fiber = Fiber.current;
setTimeout(function() {
View Arduino-Makefile
# Everything gets built in here (include BOARD_TAG now)
ifndef OBJDIR
OBJDIR = $(PROJECT_DIR)/bin/$(BOARD_TAG)/$(CURRENT_DIR)
$(call show_config_variable,OBJDIR,[COMPUTED],(from BOARD_TAG))
else
$(call show_config_variable,OBJDIR,[USER])
endif
View john zsh theme
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/
# Mar 2013 ys
# Machine name.
function box_name {