Skip to content

Instantly share code, notes, and snippets.

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

Adrian Fedoreanu phedoreanu

🏠
Working from home
View GitHub Profile
package main
import "fmt"
func main() {
s := "Let's hack together!"
fmt.Printf("%# x\n", s)
fmt.Println([]byte(s))
}
package main
import (
"fmt"
)
func insertionSort(a []int, asc bool) {
for i := 1; i < len(a); i++ {
for j := i; j > 0; j-- {
switch asc {
package main
import (
"fmt"
)
func xorSwap(x, y *int) {
if x != y {
*x ^= *y;
*y ^= *x;
angular.module('file.upload', [])
.factory('fileSvc', ['$http', '$q', function ($http, $q) {
'use strict';
var factory = {};
factory.readFile = function (file) {
return $q(function (resolve, reject) {
if (!file)
reject('file= ' + file);
@phedoreanu
phedoreanu / requests.sh
Last active January 30, 2016 17:07
https GET request fails with SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)
#!/bin/bash
env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" CFLAGS="-I/usr/local/opt/openssl/include" pip install requests[security] urllib3
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --bip=172.17.42.1/16
launchctl list | sed -E "s/(.*com.apple.*)//g" | sed '/^\s*$/d'
#! /bin/bash
echo "OS X update"
softwareupdate -ia
echo "Brew update"
brew update && brew upgrade --all && brew cleanup
#echo "pip2 update"
#pip2 list -o > pip.txt
@phedoreanu
phedoreanu / brew ffmpeg install
Last active April 9, 2018 10:44
brew ffmpeg install with mp4 libfaac & fdk-aac & libvpx
brew install libvpx ffmpeg --with-libvpx --with-libfaac --with-fdk-aac
Raspbian Jessie:
./configure --enable-libfreetype --enable-gpl --enable-nonfree --enable-libx264 --enable-libass --enable-libmp3lame --enable-zlib --enable-postproc --enable-pthreads
@phedoreanu
phedoreanu / gist:dd2e13c1261630be0670
Created July 8, 2014 09:13
chmod +x ~/src/hooks/post-receive/
#!/bin/bash
GIT_WORK_TREE=~/app/ git checkout -f
chown -R http:http ~/app