Skip to content

Instantly share code, notes, and snippets.

@AdoPi
AdoPi / battery_indicator.sh
Created January 30, 2017 23:15
Tmux conf 2016 [macOs]
# Github : @AdoPi
###########################################
# OSX - Zelda battery indicator by @AdoPi #
###########################################
zmodload zsh/mathfunc
# HEART CONSTANTS
# 💙 💜 💛 💚 ♡ ♥ ❤
NB_LIVES=3
@AdoPi
AdoPi / adonorm.zsh-theme
Created October 12, 2014 10:37
My personal zsh theme based on norm theme
PROMPT='%{$fg[blue]%}λ %{$fg[yellow]%}%n%{$fg[yellow]%}@%m %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%}) %{$reset_color%}"
@AdoPi
AdoPi / build.sh
Created May 10, 2014 21:18
compile a qt application on mac osx
cd dir_project
#write your code after that:
qmake -project
#create the makefile and compile the code
qmake -makefile
make
#create a dmg which contains your gorgeous app!
@AdoPi
AdoPi / Panel.java
Created April 18, 2014 08:49
Save JPanel as image
import java.awt.*;
import javax.swing.*;
import java.io.*;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
public class Panel extends JPanel {
/**
* Save the Panel as image with the name and the type in parameters
@AdoPi
AdoPi / session.socket.io.js
Created March 5, 2014 17:10
session.socket.io without error manager
module.exports = SessionSockets;
function SessionSockets(io, sessionStore, cookieParser, key) {
key = typeof key === 'undefined' ? 'connect.sid' : key;
var sessionSockets = this;
this.on = function(event, callback) {
return bind(event, callback, io.sockets);
};
@AdoPi
AdoPi / Gruntfile.js
Last active August 29, 2015 13:55
Gruntfile for express and livereload
module.exports = function(grunt) {
// load all grunt tasks
require('load-grunt-tasks')(grunt);
// Configure Grunt
grunt.initConfig({
//it will allow to run nodemon and watch at the same time
concurrent: {
dev: {
tasks: ['nodemon', 'watch'],
@AdoPi
AdoPi / app.js
Created January 28, 2014 09:31
handlebar helpers for express
//handlebarjs
var hbs = require('express3-handlebars').create({
helpers: {
img: function(name,alt) { return '<img src="images/'+name+'" alt="'+alt+'">';},
styles: function() {
//get directory name
var fs = require('fs');
var files;
/* make the array which will be used for css files*/
files= fs.readdirSync(__dirname+'/public/stylesheets');