Skip to content

Instantly share code, notes, and snippets.

View fgimian's full-sized avatar

Fotis Gimian fgimian

View GitHub Profile
@mattheath
mattheath / Apple Keyboard Autohotkey Script
Created March 24, 2011 12:37
A script for autohotkey to remap keys when using an Apple Keyboard with a Windows PC
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: Matt Heath <matt@mattheath.com>
;
; Script Function:
; Remaps keys when using an Apple Keyboard with a Windows PC
;
@mfenniak
mfenniak / gist:2978805
Created June 23, 2012 16:01
An extension of Flask that adds file hashes to static file URLs built by url_for("static"...)
import os.path
import contextlib
import hashlib
from flask import Flask
from flask.helpers import safe_join
# Injects an "h" parameter on the URLs of static files that contains a hash of
# the file. This allows the use of aggressive cache settings on static files,
# while ensuring that content changes are reflected immediately due to the
# changed URLs. Hashes are cached in-memory and only checked for updates when
@kbinani
kbinani / get_package_id.sh
Created July 24, 2013 14:29
Get package id from a *.pkg file (Mac OSX).
#!/bin/bash
function get_package_id { (
readonly PKG_INFO=PackageInfo
local PKG=$(cd "$(dirname "$1")"; pwd)/$(basename "$1")
local EXCLUDES=
for FILE in $(xar -t -f "$PKG" | grep -v $PKG_INFO); do
EXCLUDES="$EXCLUDES --exclude $FILE"
done
local TEMP=$(mktemp -t hoge | tr -d '\r')
@harvimt
harvimt / cffi_test.c
Created March 10, 2014 07:52
lib7zip minimal c example.
#include <stdio.h>
#include <windows.h>
#include <wchar.h>
#include <initguid.h>
#include "pstdint.h"
DEFINE_GUID(CLSID_CFormat7z,
0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x07, 0x00, 0x00);
DEFINE_GUID(IID_IInArchive,
@avillafiorita
avillafiorita / .colors.csv
Created July 16, 2014 11:27
change osx terminal colors and font from the command line
LightPink1 #ffbdc5 255 189 197 {65535 48573 50629}
pink4 #9d777f 157 119 127 {40349 30583 32639}
pink3 #d7a3ad 215 163 173 {55255 41891 44461}
pink2 #f2b9c4 242 185 196 {62194 47545 50372}
pink1 #ffc3cf 255 195 207 {65535 50115 53199}
HotPink4 #9e4f75 158 79 117 {40606 20303 30069}
HotPink3 #d878a1 216 120 161 {55512 30840 41377}
HotPink2 #f383b5 243 131 181 {62451 33667 46517}
HotPink1 #ff87c1 255 135 193 {65535 34695 49601}
DeepPink4 #9e1e62 158 30 98 {40606 7710 25186}
@marc-fez
marc-fez / Get-KeepassPW
Created October 29, 2014 14:57
KPScript retrieve password in Powershell
function Get-KeepassPW{
$result = $null
$KeePath = "C:\Program Files (x86)\KeePass Password Safe 2\KPScript.exe"
# Path to your database
$KeeDataPath = "C:\Users\MyUser\Documents\KeePass\Database.kdbx"
while(!$result){
$pass = Read-Host 'What is your KeePassword?' -AsSecureString
$KePassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pass))
$KeeCommands = @(
"-c:GetEntryString"
@FND
FND / README.md
Last active May 4, 2021 06:54
Falcon WSGI application with asyncio

Getting Started

$ pip install falcon
$ python3 app.py

alternatively with Gunicorn (for HTTP/1.1):

$ pip install gunicorn

$ gunicorn app:app

@rickychilcott
rickychilcott / gist:3222c15663dac7d987a1
Created September 9, 2015 19:09
Logic Package Downloads
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/GarageBandBasicContent.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/JamPack1.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/JamPack4_Instruments.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_AppleLoopsChillwave.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_AppleLoopsDeepHouse.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_AppleLoopsDubstep.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_AppleLoopsElectroHouse.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_AppleLoopsHipHop.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_AppleLoopsLegacy1.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_AppleLoopsLegacyRemix.pkg
using System;
using Newtonsoft.Json;
using System.Reactive.Linq;
using Nito.AsyncEx;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Threading;
using System.Reactive.Threading.Tasks;
namespace Playground
@ksylvan
ksylvan / gist:2aacf2b466741a5468b2ea7ab475ee97
Last active October 10, 2017 13:52
Ansible playbook for fixing up a Mac Dock using dockutil
# Based on https://blog.vandenbrand.org/2016/01/04/how-to-automate-your-mac-os-x-setup-with-ansible/
#
- hosts: all
tasks:
- name: Current Dock names
shell: >
dockutil --list |
python -c 'import sys; [sys.stdout.write(line.split("\t")[0] + "\n")
for line in sys.stdin]'
register: dockitems