Skip to content

Instantly share code, notes, and snippets.

View makmanalp's full-sized avatar

Mehmet Ali "Mali" Akmanalp makmanalp

View GitHub Profile
# ./configure --prefix=/usr/local/Cellar/ffmpeg/0.11.1 --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --cc=/usr/bin/clang --host-cflags='-Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7' --host-ldflags=-L/usr/local/lib --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
ACODEC_TESTS='ac3_fixed_test
adpcm_adx_test
adpcm_ima_qt_test
adpcm_ima_wav_test
adpcm_ms_test
adpcm_swf_test
adpcm_yam_test
alac_test
aref_test
@makmanalp
makmanalp / gist:0d2a80fb05f74c07269c
Created May 30, 2014 15:51
remove_spans test cases
import unittest
def remove_spans(string, spans):
return string
class TestRemoveSpans(unittest.TestCase):
def test_one_span(self):
s = "I am a test string! Hahaaa! Narwhals!"
self.assertEquals("I am a string! Hahaaa! Narwhals!",
@makmanalp
makmanalp / gist:e51892bf5a66eb8cde4a
Last active August 29, 2015 14:02
The "blah" solution, O(n) time and O(n + m) space
def remove_spans(string, spans):
if len(spans) == 0:
return string
result = []
span_iter = iter(spans)
current_span = span_iter.next()
@makmanalp
makmanalp / gist:2e9cd95f0cd9b38a679c
Last active August 29, 2015 14:02
Pandas merge: detecting where data came from
from pandas import DataFrame, merge
df = DataFrame(np.random.randn(10, 2), columns=["id", "sex"])
df2 = DataFrame(np.random.randn(10, 2), columns=["user_id", "name"])
df.id = range(10)
df2.user_id = range(3,13)
merge(df, df2, left_on="id", right_on="user_id", how="outer")
"""
id sex user_id name
@makmanalp
makmanalp / sshtest-playbook.yml
Last active June 18, 2021 15:06
SSH agent forwarding tester for ansible / vagrant
---
- hosts: all
sudo: no
tasks:
- shell: echo "Client= [$SSH_CLIENT] Sock= [$SSH_AUTH_SOCK]"
register: myecho
- debug: msg="{{myecho.stdout}}"
- shell: ssh-add -l
register: myecho
- debug: msg="{{myecho.stdout}}"
@makmanalp
makmanalp / What_did_Japan_export_in_2012_.svg
Last active August 29, 2015 14:03
Cairo svg to pdf - resulting pdf is slow to render
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@makmanalp
makmanalp / 00_notes.md
Last active August 29, 2015 14:06
HMDC / IQSS RCE Notes to run python batch jobs with condor

Submitting a Batch Job

Use python.submit to submit a script to condor with condor_submit python.submit.

Edit the file names to match what you'd normally use.

Change the input script to list_installed_packages.py to view all the installed packages / versions. View the out file.

HMDC cluster has these as of Sep 26 2014:

@makmanalp
makmanalp / sorttest.py
Created November 10, 2014 21:01
Default sorting behavior in python
In [1]: a = [4, 5, "x", True, 1, "a", "b"]
In [2]: print sorted(list(a))
[True, 1, 4, 5, 'a', 'b', 'x']
@makmanalp
makmanalp / gist:a8d0f79abc8c94f3162f
Last active August 29, 2015 14:11
Ansible commands to bootstrap get-pip to work around ubuntu issue with missing ensurepip
- name: create a new venv
shell: "pyvenv-3.4 --without-pip {{atlas_prefix}}/env/"
- name: install pip from get-pip into env
shell: ". {{atlas_prefix}}/env/bin/activate; curl https://bootstrap.pypa.io/get-pip.py | python3"
@makmanalp
makmanalp / comparison.md
Last active March 14, 2023 14:58
Angular vs Backbone vs React vs Ember notes

Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.

My top contenders, mostly based on popularity / community etc:

  • Angular
  • Backbone
  • React
  • Ember

Mostly about MVC (or derivatives, MVP / MVVM).