Skip to content

Instantly share code, notes, and snippets.

View fasiha's full-sized avatar
💭
🧘‍♂️🐻

Ahmed Fasih fasiha

💭
🧘‍♂️🐻
View GitHub Profile
@klokan
klokan / Dockerfile
Created January 29, 2015 01:13
GDAL in Docker - stable GDAL with JP2KAK, MRSID and ECW: https://registry.hub.docker.com/u/klokantech/gdal/
FROM debian:7
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -qq update \
&& apt-get -qq -y --no-install-recommends install \
autoconf \
automake \
build-essential \
curl \
@Kimtaro
Kimtaro / gist:ab137870ad4a385b2d79
Created December 26, 2014 12:06
Add to mecab dictionary
# Put new words in a CSV with this format
# 表層形,左文脈ID,右文脈ID,コスト,品詞,品詞細分類1,品詞細分類2,品詞細分類3,活用形,活用型,原形,読み,発音
# surface_form,left_context_id,right_context_id,cost,part_of_speech,pos_division_1,pos_division_2,pos_division_3,inflection_type,inflection_style,lemma,reading,pronunciation
$ echo "fasihsignal,-1,-1,100,名詞,一般,*,*,*,*,fasihsignal,ファシシグナル,ファシシグナル" > a.csv
# Then use mecab-dict-index to compile the csv into a .dic file, based on an existing mecab dictionary file
$ /usr/local/Cellar/mecab/0.996/libexec/mecab/mecab-dict-index -d/usr/local/Cellar/mecab/0.996/lib/mecab/dic/ipadic/ -u a.dic -f utf8 -t utf8 a.csv
# The use it
$ mecab -ua.dic
@cmawhorter
cmawhorter / .bash_profile
Created October 21, 2014 19:53
Add alias to bash_profile to get a quick http server anywhere. Just type H to serve current directory.
# http://stackoverflow.com/a/12269225/670023
# Binds to localhost
alias H="echo 'Serving HTTP on 127.0.0.1 port 8000 ...'; python -c 'import BaseHTTPServer as bhs, SimpleHTTPServer as shs; bhs.HTTPServer((\"127.0.0.1\", 8000), shs.SimpleHTTPRequestHandler).serve_forever()'"
@JayKickliter
JayKickliter / Julia FFTS.jl
Last active August 29, 2015 13:57
Calling FFTS c functions from Julia
# Complex transforms
# Sign argument
# -1 = Complex to Complex reverse FFT
# 1 = Complex to Complex forward FFT
# ffts_plan_t *ffts_init_1d(size_t N, int sign);
# Create a plan for a forward 1D FFT of size 16
N = 2^16
Direction = 1
ffts_plan = ccall((:ffts_init_1d, "libffts"), Ptr{Void}, (Csize_t, Cint), N, Direction)
@estebistec
estebistec / README.md
Last active February 3, 2021 23:16
This minimal setup allows you to run nginx using the current folder as the doc-root. NOTE: python's simplehttpserver may be good enough for you. This is just a nice simple nginx setup.
  1. Get all of these files into the target folder
  2. Run the following commands:
chmod +x *.sh
./nginx-start.sh
@yanofsky
yanofsky / LICENSE
Last active May 7, 2024 12:36
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@rmcgibbo
rmcgibbo / install.md
Last active October 14, 2021 00:17
Scientific Python From Source, with MKL

Scientific Python From Source

This document will walk you through compiling your own scientific python distribution from source, without sudo, on a linux machine. The core numpy and scipy libraries will be linked against Intel MKL for maximum performance.

This procedure has been tested with Rocks Cluster Linux 6.0 (Mamba) and CentOS 6.3.

Compiling Python From Source

@Yaffle
Yaffle / Math.nextUp.js
Last active February 2, 2017 22:49
Math.nextAfter, Math.nextDown, Math.nextUp, Math.ulp in javascript
(function (global) {
"use strict";
// Math.nextUp
// Note:
// Math.nextDown = function (x) { return -Math.nextUp(-x); };
// Math.nextAfter = function (x, y) { return y < x ? -Math.nextUp(-x) : (y > x ? Math.nextUp(x) : (x !== x ? x : y)); };
// Math.ulp = function (x) { return x < 0 ? Math.nextUp(x) - x : x - (-Math.nextUp(-x)); };
var EPSILON = Math.pow(2, -52);
@sartak
sartak / a.md
Last active March 22, 2024 22:16
Anki 2 annotated schema
@endolith
endolith / export_google_starred_locations.py
Created October 16, 2012 02:29
Export Google Maps starred locations
# -*- coding: utf-8 -*-
"""
Go to Google Bookmarks: https://www.google.com/bookmarks/
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en
After downloading the html file, run this script on it to generate a KML.
"""