Skip to content

Instantly share code, notes, and snippets.

View freeswitch 1.6 build steps Ubuntu 14.04.sh
#add the repositories
sudo apt-get update && sudo apt-get install -y curl
curl https://files.freeswitch.org/repo/ubuntu/freeswitch-1.6/freeswitch_archive_g0.pub | apt-key add -
echo "deb http://files.freeswitch.org/repo/ubuntu/freeswitch-1.6/ trusty main" | sudo tee /etc/apt/sources.list.d/freeswitch.list
sudo apt-get update
# install dependencies
View example.go
package main
import (
"database/sql/driver"
"encoding/json"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
@mraible
mraible / gsutil-upload.sh
Last active Sep 30, 2020
Upload optimized assets to Google Cloud Storage
View gsutil-upload.sh
# Rsync to remove old files
gsutil -m rsync -x '.git*' -c -d -r dist gs://bucket/
# Upload and gzip HTML, CSS and JavaScript
gsutil -m cp -z "html,css,js" -r dist/** gs://bucket/
# Set expires headers (6 months) on JS and CSS assets
gsutil -m setmeta -h "Cache-Control: public, max-age=15552000" gs://bucket/assets/**
# Make sure there's no expiration headers on HTML files
@jinzhu
jinzhu / main.go
Created Oct 1, 2015
handle postgres json with gorm
View main.go
package main
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
func main() {
@mohamed
mohamed / build-gn.sh
Last active Sep 23, 2022
Build Google gn build tool standalone
View build-gn.sh
#!/usr/bin/env sh
set -euv
# Updated on April 2019 to reflect changes in GN
# See:
# https://github.com/ninja-build/ninja
# https://gn.googlesource.com/gn/
# We need a recent git
@voter101
voter101 / Gulpfile.js
Last active Nov 29, 2021
Gulpfile for Rails application with replaced Sprockets with Gulp
View Gulpfile.js
'use strict'
var gulp, sass, babelify, browserify, watchify, source, util;
gulp = require('gulp');
sass = require('gulp-sass');
babelify = require('babelify')
browserify = require('browserify');
watchify = require('watchify');
source = require('vinyl-source-stream');
@icholy
icholy / map_filter_reduce.go
Last active Feb 20, 2017
chaining channels in go
View map_filter_reduce.go
package main
import (
"unicode/utf8"
)
type Item string
type Stream chan Item
type Acc string
@dspezia
dspezia / example.c
Created Nov 26, 2012
Example of Redis zset polling daemon
View example.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include "hiredis.h"
#include "async.h"
#include "adapters/ae.h"
#include "sha1.h"
@lucasfais
lucasfais / gist:1207002
Created Sep 9, 2011
Sublime Text 2 - Useful Shortcuts
View gist:1207002

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt