This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr = ["a","b","c","d","e","f","g","h","i","j"]; | |
for(i = 0; i <= Math.pow(2,arr.length)-1; i++){ | |
var mask = i; | |
console.log("-------------------------------------" + mask); | |
var combination = ""; | |
for(y=0; y<arr.length; y++){ | |
if((mask & Math.pow(2,y)) == Math.pow(2,y)) combination += " " + arr[y]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
) | |
type OfferGenerator struct { | |
offers []Offer | |
} | |
type RoomGenerator struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int sensors[]{A0,A1,A2,A3,A4,A5}; | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
int numberOfSensors = sizeof(sensors)/sizeof(int); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"time" | |
"syscall" | |
"sync" | |
"fmt" | |
"os" | |
"os/signal" | |
"context" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stty rows 50 && stty cols 2500 && export PS1='\u@\h: ' bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kata | |
import ( | |
"strings" | |
) | |
// Boolfuck entry point for codewars kata | |
func Boolfuck(code string, input string) string { | |
return NewBookFuckInterpreter().Run(code, input) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
err_report() { | |
echo "error in inner script: $(caller):$1" | |
} | |
trap 'err_report $LINENO' ERR | |
echo "INNER SCRIPT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func logAccessInfo(addr string, port int, path, protocol string) { | |
ifaces, err := net.Interfaces() | |
if err != nil { | |
logrus.Infof("access it via %s://%s%s", protocol, addr, path) | |
} | |
for _, i := range ifaces { | |
addrs, err := i.Addrs() | |
if err != nil { | |
continue | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"time" | |
) | |
func main() { |
OlderNewer