Skip to content

Instantly share code, notes, and snippets.

View RoySegall's full-sized avatar
⌨️
God is a coder

Roy Segall RoySegall

⌨️
God is a coder
View GitHub Profile
# General aliases.
alias edit_aliases='code /Users/roy/.oh-my-zsh/custom/aliases.zsh'
alias reload_aliases='source ~/.zshrc'
alias video_to_gif='function video_to_gif(){ ffmpeg -i $1 $2 && gifsicle -O3 $2 -o $2 && say "Video is ready!"};video_to_gif'
alias www='cd /Users/roy/projects'
# the fuck - https://github.com/nvbn/thefuck#installation
eval $(thefuck --alias)
@decors
decors / index.html
Last active September 18, 2021 15:45
Electron open-file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Electron</title>
</head>
<body>
<script>
var ipc = require('ipc');
source ~/.profile
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
export PATH="$HOME/.composer/vendor/bin:$PATH"
export PATH="$PATH:/Applications/MAMP/Library/bin"
export SIMPLETEST_DB=mysql://root:root@localhost/drupal8;
export SIMPLETEST_BASE_URL=http://localhost/drupal8
export XDEBUG_CONFIG="idekey=PHPSTORM"
@neumino
neumino / gist:6554108
Created September 13, 2013 18:11
Filtering nested arrays with RethinkDB
r.table("test").filter( function(doc) {
return doc("adresses").contains(function(adress) {
return adress("city").eq("Paris")
})
})
/*
{
@elazarl
elazarl / cp.go
Last active June 27, 2020 14:42
Unfortunately, searching for "golang copy file" gives subtly wrong code snippets (e.g. https://groups.google.com/d/msg/golang-nuts/JNyQxQLyf5o/kbGnTUK32TkJ that don't check close error code). This is an attempt to copy file content from `src` to `dst`
package cp
import (
"io"
"os"
)
func cp(dst, src string) error {
s, err := os.Open(src)
if err != nil {
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"