Skip to content

Instantly share code, notes, and snippets.

View kissgyorgy's full-sized avatar

György Kiss kissgyorgy

View GitHub Profile
@kissgyorgy
kissgyorgy / del_trailing_spaces.sh
Created February 20, 2014 01:25
Bash: delete trailing spaces
#!/bin/bash
# On OS X 10.9 (see: http://stackoverflow.com/questions/19242275/sed-re-error-illegal-byte-sequence-on-mac-os-x)
# export LC_CTYPE=C
# export LANG=C
# http://stackoverflow.com/questions/149057/how-to-remove-trailing-whitespace-of-all-files-recursively
find . -not \( -name .svn -prune -o -name .git -prune \) -type f -print0 | xargs -0 sed -i '' -E "s/[[:space:]]*$//"
"""
setup.py
py2app setup script for creating a semi-standalone .app
around a Maya API based PyQt4 application.
Only bundled PyQt4 with the app, and references the Maya install
location for the python environment.
Allows for a portable GUI application that does not require
@kissgyorgy
kissgyorgy / osx_commands.sh
Created November 14, 2014 10:12
OS X commands
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent'
@kissgyorgy
kissgyorgy / closure_hack.py
Last active August 29, 2015 14:18
Python: Closure hack
# http://stackoverflow.com/a/23558809/720077
def fibonacci():
a, b = [1], [0]
def fibo():
a[0], b[0] = b[0], a[0] + b[0]
return a[0]
return fibo
@kissgyorgy
kissgyorgy / pizzapicker.py
Created December 6, 2015 15:40
Random pizza picker from website
# -*- coding: utf-8 -*-
import random
from lxml import etree
import requests
def main(url):
response = requests.get(url)
root = etree.HTML(response.content)
@kissgyorgy
kissgyorgy / self_restart.au3
Last active December 10, 2015 00:19
AutoIt: self restart
; Author UP_NORTH
Func RestartScript()
If @Compiled = 1 Then
Run( FileGetShortName(@ScriptFullPath))
Else
Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
EndIf
Exit
EndFunc
@kissgyorgy
kissgyorgy / delete_current_script.au3
Last active December 10, 2015 00:19
AutoIt: Delete current script
; IMPORTANT MAKE A COPY OF SCRIPT BEFORE DELETION
; Deletes the running script
; Author Larry
Func SuiCide()
$SC_File = @TEMPDIR & "\suicide.bat"
FileDelete($SC_File)
$SC_batch = 'loop:' & @CRLF & 'del "' & @SCRIPTFULLPATH & '"' & @CRLF & _
'ping -n 1 -w 250 zxywqxz_q' & @CRLF & 'if exist "' & @SCRIPTFULLPATH & _
'" goto loop' & @CRLF & 'del suicide.bat' & @CRLF
@kissgyorgy
kissgyorgy / gist:4433092
Created January 2, 2013 08:47
vBulletin 4.2 spoiler code
<div style="margin:10px; margin-top:5px">
<div style="margin-bottom:2px">
<b>Spoiler</b>: <input class="button" type="button" value="Mutat" onclick="rejt(this)">
</div>
<div style="margin: 0px; padding: 6px; border: 1px inset;">
<div class="spoiler" style="visibility: hidden;">
{param}
</div>
</div>
</div>
@kissgyorgy
kissgyorgy / set_style.au3
Created January 13, 2013 01:01
AutoIt: Set window style in runtime
; For explanation, see this forum topic: http://www.autoitscript.com/forum/topic/147424-disable-or-remove-close-minimize-maximize-buttons-on-any-window-in-runtime/
#include <WinAPI.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
$h = WinGetHandle("Untitled - Note")
$iOldStyle = _WinAPI_GetWindowLong($h, $GWL_STYLE)
ConsoleWrite("+ old style: " & $iOldStyle & @CR)
@kissgyorgy
kissgyorgy / edit_script.au3
Last active December 11, 2015 01:19
AutoIt: Edit script
Func EditScript()
ShellExecuteWait(@ProgramFilesDir & '\AutoIt3\SciTE\SciTE.exe', @ScriptFullPath, @ScriptDir)
RestartScript()
EndFunc