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
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);
@sagaban
sagaban / application.controller.js
Created June 2, 2016 06:48 — forked from Serabe/application.controller.js
Named Positional Parameters
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
currentBooleanValue: false,
obj: Ember.Object.create({
a: 1,
b: 2,