Skip to content

Instantly share code, notes, and snippets.

View sagaban's full-sized avatar
🦆
Enjoying life

Santiago Bandiera sagaban

🦆
Enjoying life
View GitHub Profile
@sagaban
sagaban / echo.js
Created June 26, 2024 17:54 — forked from bszwej/echo.js
Pure Node.js echo server, that logs all incoming http requests (method, path, headers, body).
const http = require('http');
const server = http.createServer();
server.on('request', (request, response) => {
let body = [];
request.on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
body = Buffer.concat(body).toString();
@sagaban
sagaban / change_window_opacity.sh
Created November 20, 2022 22:56 — forked from ikbelkirasan/change_window_opacity.sh
Change window opacity in Linux using keyboard shortcuts
#!/bin/bash
function get_active_window() {
printf "0x%08x" $(xdotool getactivewindow)
}
function get_current_opacity() {
window="$1"
opacity=$(xprop -id $window | grep _NET_WM_WINDOW_OPACITY | awk '{print $3}')
if [ -z $opacity ]; then
#!/bin/bash
# Check package availability
command -v docker-compose >/dev/null 2>&1 || { echo "[Error] Please install docker-compose"; exit 1; }
command -v gzip >/dev/null 2>&1 || { echo "[Error] Please install gzip"; exit 1; }
# Change to the script's directory & create directory
cd $(dirname "$(readlink -f "$0")")
mkdir -p ./dbdumps
KEYBINDINGS
byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings
are:
F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
@sagaban
sagaban / components.accordion-item.js
Created November 16, 2016 08:23
Accordion-example
import Ember from 'ember';
export default Ember.Component.extend({
});
function talk(){
console.log(this.sound);
}
let animal = {
talk
};
let cat = {
sound: "Miau!"
(function (/* 01. reduce (v, fn, b) */) {
var reduce = function (v, fn, b) {
return reduceAux (v, fn, b, 0, b);
};
var reduceAux = function (v, fn, b, p, ac){
return p > v.length - 1 ?
ac :
var fullname = 'John Doe';
var obj = {
fullname: 'Colin Ihrig',
prop: {
fullname: 'Aurelio De Rosa',
getFullname: function() {
return this.fullname;
}
}
};
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super(...arguments);
console.log(this.get('myArr'))
},
myArr: Ember.A([]),
actions: {
import Ember from 'ember';
export default Ember.Component.extend({
myArr: Ember.K,
actions: {
addNumber() {
let random = Math.ceil(10 * Math.random());
this.get('myArr').pushObject(random);