Skip to content

Instantly share code, notes, and snippets.

View un33k's full-sized avatar
🎯
Focusing

Val Neekman un33k

🎯
Focusing
View GitHub Profile
@un33k
un33k / Install_tmux
Created February 3, 2014 20:01 — forked from simme/Install_tmux
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
#!/bin/sh
# /share/MD0_DATA/.qpkg/autorun/autorun-plexconnect.sh
# chmod +x /share/MD0_DATA/.qpkg/autorun/autorun-plexconnect.sh
curl -L https://gist.github.com/tommeier/6255771/raw/update_plex_connect.sh | bash &
@un33k
un33k / getter_setter_example.py
Last active January 4, 2016 01:28
getter & setter example
class GetterSetterExample(object):
_some_local_attribute = 1
@property
def some_attribute(self):
return self._some_local_attribute
@some_attribute.setter
def some_attribute(self, value):
@un33k
un33k / Doc.rst
Created January 10, 2014 01:32 — forked from copitux/Doc.rst

Django request flow

-------------------------------                         ------------------ Django --------------------
| Browser: GET /udo/contact/2 |    === wsgi/fcgi ===>   | 1. Asks OS for DJANGO_SETTINGS_MODULE      |
-------------------------------                         | 2. Build Request (from wsgi/fcgi callback) |
                                                        | 3. Get settings.ROOT_URLCONF module        |
                                                        | 4. Resolve URL/view from request.path      | # url(r'^udo/contact/(?P<id>\w+)', view, name='url-identifier')
                                                        | 5. Apply request middlewares               | # settings.MIDDLEWARE_CLASSES
@un33k
un33k / video_converter.py
Created January 5, 2014 14:30
Quickly convert all Windows Media Videos to MP4 in a directory using ffmpeg.
import os
import sys
# Install ffmpeg
# Put all your wmv in a directory
# Copy this file inside the directory
# run `python video_converter.py
############################################
WMV_DIR = "."
wmv_files = [ f for f in os.listdir(WMV_DIR) if os.path.isfile(os.path.join(WMV_DIR,f)) and 'wmv' in f ]
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
# http://www.ispcolohost.com/2013/07/11/connecting-a-dell-ultrasharp-u3014-to-a-mac-ugh/
# Update 2013-06-24: added -w0 option to prevent truncated lines
require 'base64'
data=`ioreg -l -w0 -d0 -r -c AppleDisplay`
@un33k
un33k / app.js
Created December 31, 2013 13:04 — forked from auser/app.js
angular.module('myApp',
['ngRoute', 'myApp.services', 'myApp.directives']
)
.config(function(AWSServiceProvider) {
AWSServiceProvider.setArn('arn:aws:iam::<ACCOUNT_ID>:role/google-web-role');
})
.config(function(StripeServiceProvider) {
StripeServiceProvider.setPublishableKey('pk_test_YOURKEY');
})
.config(function($routeProvider) {
@un33k
un33k / .gitconfig
Last active December 30, 2015 15:19 — forked from davemo/.gitconfig
Macbook Prefs
[alias]
co = checkout
ci = commit
st = status
br = branch
ln = log --name-status
df = diff
dc = diff --cached
lg = log -p
pl = log --pretty='format:"%h %s" --graph'
@un33k
un33k / nginx.conf
Last active May 22, 2025 09:14
Enable Nginx to send Content-Dispositions on specific files
server {
listen *:80;
server_name www.example.com;
rewrite ^(.*) http://example.com $1 permanent;
}
server {
listen *:80;
server_name example.com;
@un33k
un33k / clock.css
Created August 4, 2013 14:27
Quick way of creating a nice "live" clock in JS
/* **************************** */
/* Timezone */
/* **************************** */
.tz_date_time .tz_circle {
position: relative;
width: 92px;
height: 92px;
padding: 1px 2px 11px 2px;
}