Skip to content

Instantly share code, notes, and snippets.

View xcambar's full-sized avatar

Xavier Cambar xcambar

View GitHub Profile
```sh
$ env | sort
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.XWX6O4Sj3X/Render
BASE16_MODE=dark
BASE16_SCHEME=flat
BROWSER=open
CHROME_BIN=CHROME_BIN=~/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
COLORFGBG=7;0
COMMAND_MODE=unix2003
@xcambar
xcambar / daily_planning.md
Last active November 21, 2018 20:27
A day at work - or "how to save my productivity and sanity against distractions and their minions: notifications"

Rules

  • No Desktop/Browser notifications
  • Read E-mails
    • early in the morning
    • late in the afternoon
    • quick check after lunch, action allowed based on volume
  • Slack
    • active notifications only for #blocking channels
  • Catch up discussions on early morning and late afternoon
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
p1: Ember.computed({
get() { return 42; }
}),
p2: Ember.computed({
get() { return 42; },
set() { return 24; }
import Ember from 'ember';
export default Ember.Controller.extend({
service: Ember.inject.service('thing-service'),
actions: {
changeColor() {
const color = this.get('service.color');
const colors = ['red', 'blue'];
import Ember from 'ember';
export default Ember.Controller.extend({
wife: {
age: 21
}
});
@xcambar
xcambar / transition_event_from_ember_app.js
Created September 3, 2015 14:24
Let the outside world know that your Ember app has successfully transitioned from a route to another
/*
* For the sake of simplicity,
* Let's assume that your app is globally regostered as `MyApp`
*/
// Prepare your app to trigger the `transitioned` event
MyApp.reopen(Ember.Evented);
MyApp.__container__.lookup('controller:application').addObserver('currentPath', function () {
var _path = this.get('currentPath');
@xcambar
xcambar / ssh_keys_inspect.sh
Created August 6, 2015 14:19
A quick look on your SSH keys - Displays the filename, owner, size and algorithm used.
find ~/.ssh -name *.pub -exec \
sh -c 'echo "$1" `ssh-keygen -l -f "$1"`' _ {} \; \
| awk -F" " -v OFS=" " '{$3="";tmp=$2;$2=$4;$4=tmp;print}' \
| column -t
@xcambar
xcambar / google_domains.csv
Created July 31, 2015 12:02
List of Google localized domains (According to https://en.wikipedia.org/wiki/List_of_Google_domains) - 2015/07/31
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
google.com
google.ac
google.ad
google.ae
google.com.af
google.com.ag
google.com.ai
google.al
google.am
google.co.ao
@xcambar
xcambar / circle.yml
Created July 29, 2015 14:35
Many Python versions in CircleCI
dependencies:
pre:
- ln -s ~/.pyenv/versions/3.3.2/bin/python3.3 $VIRTUAL_ENV/bin
- ln -s ~/.pyenv/versions/3.4.1/bin/python3.4 $VIRTUAL_ENV/bin
@xcambar
xcambar / nginx-cors.conf
Last active November 1, 2021 09:27 — forked from algal/nginx-cors.conf
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests