Skip to content

Instantly share code, notes, and snippets.

View andrewvmail's full-sized avatar

momoterraw andrewvmail

View GitHub Profile
@je-so
je-so / testprogram.c
Last active January 13, 2024 22:27
Xlib transparent window with OpenGL support
/*
____ _____
/\__ \ /\ ___\
\/__/\ \ \ \ \__/_
\ \ \ \ \____ \
_\_\ \ \/__/_\ \
/\ _____\ /\ _____\
\/______/ \/______/
Copyright (C) 2011 Joerg Seebohn
@munhitsu
munhitsu / gist:1034876
Last active November 29, 2020 09:10
python 2.7.5 install on OSX (10.8+) using brew (pip, easy_install, virtualenv, virtualenvwrapper)
# In case you had some strange python installation
# NOTE: .pydistutils.cfg seems to be not compatible with brew install python
# areas I needed to clean before installation
# clean up ~/Library/Python
# clean up .local
# preconditions:
# xcode with command line tools installed
xcode-select --install
@manast
manast / interval.js
Last active November 15, 2023 22:08
Accurate Javascript setInterval replacement
function interval(duration, fn){
var _this = this
this.baseline = undefined
this.run = function(){
if(_this.baseline === undefined){
_this.baseline = new Date().getTime()
}
fn()
var end = new Date().getTime()
@thijsc
thijsc / gist:1391107
Created November 24, 2011 11:08
Select item from chosen js select with Capybara and Selenium
def select_from_chosen(item_text, options)
field = find_field(options[:from])
option_value = page.evaluate_script("$(\"##{field[:id]} option:contains('#{item_text}')\").val()")
page.execute_script("$('##{field[:id]}').val('#{option_value}')")
end
@wycks
wycks / htaccess cache and stuff
Last active March 26, 2022 20:48
Boilerplate .htaccess from Paul Irish with WordPress added
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@0xjjpa
0xjjpa / chrome.md
Created December 9, 2012 04:37
Understanding Google Chrome Extensions

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@Mins
Mins / mysql_secure.sh
Last active February 16, 2024 00:03
Automating mysql_secure_installation
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10
@foozmeat
foozmeat / openssl-build.sh
Last active December 12, 2023 19:41
A shell script to build openssl for iOS and Mac. It currently builds: Mac -> i386 & x86_64 // iOS -> armv7, arm64 // iOS Simulator -> i386 & x86_64.
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
@lox
lox / PostPolicy.php
Last active April 24, 2023 03:15
Multiple file uploads from browser to S3 via Dropzone.
<?php
namespace Aws\S3;
/**
* @category Amazon
* @package AWS
* @copyright Copyright 2009 Amazon Technologies, Inc.
* @link http://aws.amazon.com
* @license http://aws.amazon.com/apache2.0 Apache License, Version 2.0