⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
https://www.ximedes.com/test-redux-action-creators-with-jest/ |
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 | |
for folder in */ ; do | |
d1=${folder%%_*} | |
for file in "$folder"*; do | |
echo "$file" | |
if [[ $file =~ \.(avi|AVI|mpeg|mpg|mov|wmv|mp4)$ ]]; then | |
datestr=${d1//' '/'-'} | |
f=${file%%.*}; |
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/sh | |
if [ "$1" == "" ]; then | |
echo "Usage: $0 <PROJECT_ROOT> <GITHUB_REPO>" | |
exit 1 | |
fi | |
if [ "$2" == "" ]; then | |
echo "Usage: $0 <PROJECT_ROOT> <GITHUB_REPO>" | |
exit 1 | |
fi |
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" | |
"regexp" | |
) | |
// Turkish Alpabetic Numeric "(),\-./" | |
func IsAlphaNumeric(text string) (ok bool) { | |
ok, _ = regexp.MatchString("^([\\(\\)\\,\\\\\\-\\./ a-zA-ZğüşıöçĞÜŞİÖÇ0-9]+)$", text) |
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
const items = [1,52,14,54,[10,1,3,5],14,6]; | |
const flatten = (arr) => { | |
const flat = [].concat(...arr) | |
return flat.some(Array.isArray) ? flatten(flat) : flat; | |
} | |
const splitAt = (arr, predicate) => { | |
var selected = []; | |
var others = []; |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
include $(GOROOT)/src/Make.inc | |
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4 | |
all: | |
$(GC) jsontest.go | |
$(LD) -o jsontest.out jsontest.$O | |
format: | |
$(GOFMT) -w jsontest.go |
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
/* This is intentionally blank just and exists to secure a decent gist name */ |
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
function toSeconds( time ) { | |
var parts = time.split(':'); | |
return (+parts[0]) * 60 * 60 + (+parts[1]) * 60 + (+parts[2]); | |
} | |
function toHHMMSS(sec) { | |
var sec_num = parseInt(sec, 10); // don't forget the second parm | |
var hours = Math.floor(sec_num / 3600); | |
var minutes = Math.floor((sec_num - (hours * 3600)) / 60); | |
var seconds = sec_num - (hours * 3600) - (minutes * 60); |