Skip to content

Instantly share code, notes, and snippets.

View SergioGeeK7's full-sized avatar
🏠
Working from home

Sergio A. SergioGeeK7

🏠
Working from home
View GitHub Profile
/**
* @author SergioGeeK7
* @param {Array} arr array to flatten
* @return {Array} flatten array.
* @example [[1,2,[3]],4] -> [1,2,3,4] , [[1,2,[3],[4]],5] -> [1,2,3,4,5].
*/
function flattenArray(arr) {
let flat = [];
const length = arr.length;
for (let i = 0; i < length; i++) {
#!/bin/zsh
PWD=`pwd`
# Copy config files
## Oh my zsh
ln -sf $PWD/.zshrc ~/.zshrc
## Tmux
#!/bin/bash
VALUE=$(cat /sys/class/leds/smc::kbd_backlight/brightness)
INCREMENT=32
TOTAL=unset
case $1 in
up)
TOTAL=`expr $VALUE + $INCREMENT`
;;
down)
@SergioGeeK7
SergioGeeK7 / .Xmodmap
Last active February 7, 2018 13:00
Linux Mod keystrokes
keycode 131 = Mode_switch
keysym j = j J Left
keysym l = l L Right
keysym i = i I Up
keysym k = k K Down
#reset: setxkbmap -option
echo XHC1 > /proc/acpi/wakeup
#echo LID0 >/proc/acpi/wakeup
@SergioGeeK7
SergioGeeK7 / introrx.md
Created April 6, 2017 19:32 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
from p in context.Periods
join f in context.Facts
on new {
id = p.periodid,
p.otherid
} equals new {
f.id,
f.otherid
} into fg
from fgi in fg.DefaultIfEmpty()
public void main (String args[]){
int z [] = {1,2,3,4};
ArrayList b = new ArrayList();
List <Integer> a= new ArrayList<>();
ArrayList <String> r = new ArrayList<>();
print(new int []{1,2,3});
@SergioGeeK7
SergioGeeK7 / lalala.sql
Created March 9, 2014 21:46
Problem SQL sa
alter authorization on database::Facturacion to sa
@SergioGeeK7
SergioGeeK7 / config.json
Last active August 29, 2015 13:56
sublime text configuracion
{
"font_face": "PragmataPro",
"font_size": 14.0,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"theme": "Soda Dark 3.sublime-theme",
"soda_folder_icons": true,