Skip to content

Instantly share code, notes, and snippets.

call plug#begin('~/.config/nvim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
call plug#end()
"<fzf quickmarks>
function! s:open_url_quickmark(line)
silent execute '!firefox ' . shellescape(split(a:line)[-1], 1)
endfunction
import socket
port_number = 4242
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_socket.bind(('0.0.0.0', port_number))
print "UDPServer Waiting for client on port", port_number
while True: print server_socket.recvfrom(1024)
require 'mittsu'
class Game
def bar
left_bar_geometry = Mittsu::BoxGeometry.new(0.2, 0.05, 1.0)
left_bar = Mittsu::Mesh.new(left_bar_geometry, Mittsu::MeshPhongMaterial.new(color: 0x888888))
@camera.add left_bar
left_bar.position.y -= 0.4
left_bar.position.z -= 1
from google.cloud import bigquery
import sys
bigquery_client = bigquery.Client(
project = "my-project")
query = bigquery_client.run_sync_query("select * from airflow.quotes_" + sys.argv[1])
query.run()
dataset = bigquery_client.dataset("airflow")
table = dataset.table("quotes")
table.reload()
result = table.insert_data(query.rows)
@yazgoo
yazgoo / dag.py
Last active January 17, 2017 10:45
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2017, 1, 1),
'email': ['mymail@mail.net'],
'email_on_failure': False,
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2017, 1, 1),
'email': ['innov-analytics@teads.tv'],
'email_on_failure': False,
@yazgoo
yazgoo / gist:f3ecb391e4839127349b
Created November 18, 2014 13:41
fuse_kafka memcheck #0
==26249==
==26249== HEAP SUMMARY:
==26249== in use at exit: 32 bytes in 2 blocks
==26249== total heap usage: 5 allocs, 3 frees, 52 bytes allocated
==26249==
==26249== LEAK SUMMARY:
==26249== definitely lost: 0 bytes in 0 blocks
==26249== indirectly lost: 0 bytes in 0 blocks
==26249== possibly lost: 0 bytes in 0 blocks
==26249== still reachable: 32 bytes in 2 blocks
@yazgoo
yazgoo / owf14.md
Last active August 29, 2015 14:08
OWF - day2

An introduction to ansible

The problem: software orchestration.
Like fabric, puppet, chef.
It is Built on YAML, is agentless (uses SSH), idempotent.
Configuration is called 'playbook'.
A group of actions is called a role.
You can define host groups, hosts, variables.
To test local provisionning, use vagrant.

@yazgoo
yazgoo / tree.rb
Created May 22, 2014 09:29
arrange process snapshot in a tree
#!/usr/bin/ruby
groups = {}
STDIN.each_line do |line|
items = line.split
pid = items[ARGV[0].to_i]
ppid = items[ARGV[1].to_i]
groups[ppid] = [] if groups[ppid].nil?
groups[ppid] << [pid, line]
end
def print_tree groups, cmd, ppid, tab = ""
@yazgoo
yazgoo / owcontroll.rb
Last active December 21, 2015 22:09
A controller mapper for Outer Wilds http://www-scf.usc.edu/~abhinavr/OW/home.html. You need to install ruby, put it in the same directory as OuterWilds_7-30-13_Data, then run ruby owcontroll.rb .
#!/usr/bin/env ruby
# License: GPLv2
# author: yazgoo
# Description: patches OuterWilds to support more controllers
# Usage: put in the same directory as OuterWilds_7-30-13_Data
require 'fileutils'
Mapping = './mapping.rb'
MainData = "OuterWilds_7-30-13_Data/mainData"
MainDataOrig = MainData + ".orig"
if not File.exist? Mapping