Skip to content

Instantly share code, notes, and snippets.

@dchest
dchest / gist:c1985fd5bef3b19bf73f3165fe2e59b6
Created October 13, 2016 07:10
Secure coding guidelines for C
Don't write in C.
@exit99
exit99 / Auto-Dave
Last active March 1, 2016 19:35
Automating Dave's Job
import time
import urllib2
from datetime import datetime
def do_dave():
while 10 < datetime.now().hour < 15:
time.sleep(5)
urllib2.urlopen('http://www.reddit.com/')
@kracekumar
kracekumar / Writing better python code.md
Last active February 19, 2024 03:06
Talk I gave at June bangpypers meetup.

Writing better python code


Swapping variables

Bad code

@Antarix
Antarix / TypeWriter.java
Last active March 4, 2021 06:12
TextView animation like type writer
import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.widget.TextView;
public class TypeWriter extends TextView {
private CharSequence mText;
private int mIndex;
private long mDelay = 150; //Default 150ms delay
@lewisgoddard
lewisgoddard / install_flash_for_midori.sh
Last active February 19, 2017 19:02
This one single method will work in both 64bit and 32bit systems by using the 32bit flash natively, or emulating it. Either way, it uses nspluginwrapper, which will pull in a lot of libraries (packages), but most of them should be quite small. You can download and execute this file or just copy and paste the whole block into your terminal, then …
clear &&
echo 'Installing Flash for Midori' &&
read -p 'Press Enter to continue, or abort by pressing CTRL+C' nothing &&
mkdir -p ~/.mozilla/plugins &&
wget https://fpdownload.adobe.com/get/flashplayer/pdc/11.2.202.626/install_flash_player_11_linux.i386.tar.gz &&
tar -zxvf install_flash_player_11_linux.i386.tar.gz libflashplayer.so &&
rm install_flash_player_11_linux.i386.tar.gz &&
if [ $(getconf LONG_BIT) = '64' ]
then
mv libflashplayer.so ~/.mozilla/plugins/libflashplayer.32.so &&
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"