Skip to content

Instantly share code, notes, and snippets.

View supaket's full-sized avatar
🐼

supaket wongkampoo supaket

🐼
View GitHub Profile
@maksimov
maksimov / lifecycle-mapping-metadata.xml
Last active February 24, 2023 15:17
Ignore unsupported M2E goals
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<lifecycleMappings>
<lifecycleMapping>
<packagingType>maven-plugin</packagingType>
<lifecycleMappingId>org.eclipse.m2e.jdt.JarLifecycleMapping</lifecycleMappingId>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@lxyu
lxyu / cros.py
Last active December 22, 2015 21:29
Flask CROS(Cross-Origin Resource Sharing) decorator simplified
import datetime
import functools
from flask import (
current_app,
make_response,
request
)
@mjhea0
mjhea0 / quick_flask.sh
Created August 24, 2013 20:28
mix your own
mkdir flaskapp && cd flaskapp
touch config.py run.py shell.py app.db requirements.txt
mkdir app
touch app/__init__.py app/constants.py
mkdir app/static app/templates
@mplewis
mplewis / flask-uwsgi-nginx-primer.md
Last active October 24, 2022 19:20
Flask + uWSGI + nginx Primer. I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

Flask + uWSGI + nginx Primer

I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

How this shit works

  • Flask is managed by uWSGI.
  • uWSGI talks to nginx.
@reidransom
reidransom / gist:6042016
Created July 19, 2013 20:13
Auto-starting VirtualBox VMs on OS X

Auto-starting VirtualBox VMs on OS X

After finding a lot of other posts on the topic that didn't work out for me this one did the trick so I'm reposting for my own sense of self preservation.

Link to original article.

Copy the Virtualbox autostart plist template file to your system's LaunchDaemons folder.

sudo cp \

/Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.plist \

@ilguzin
ilguzin / idea.vmoptions
Last active March 21, 2022 14:46
High performance Mac OS X IntelliJ IDEA options: /Applications/IntelliJ IDEA 12 CE.app/bin/idea.vmoptions
-server
-Xms512m
-Xmx2048m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=256m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC
-XX:+AggressiveOpts
-XX:+CMSClassUnloadingEnabled
@jhoblitt
jhoblitt / tw.rb
Created June 18, 2013 17:03
Attempting to testing facter facts with rspec
require 'facter'
Facter.add(:tw_cli) do
confine :kernel => "Linux"
setcode do
Facter::Util::Resolution.which('tw_cli')
end
end
@bsalim
bsalim / php speed up tips.html
Created January 3, 2013 09:09
63 Tips for speeding up PHP
<html>
<body>
<p>Here are Webber’s points:</p>
<ul>
<li>If a method can be static, declare it static. Speed improvement is by a factor of 4.</li>
<li>echo is faster than print.(<em>* compare with list from phplens by John Lim</em>)</li>
<li>Use echo’s multiple parameters instead of string concatenation.</li>
<li>Set the maxvalue for your for-loops before and not in the loop.</li>
<li>Unset your variables to free memory, especially large arrays.</li>
<li>Avoid magic like __get, __set, __autoload</li>
/* TypeTireitles Authors Date
*Create DFS and TypeTireries Chatsiri.rat 06/10/2012
*Separate trie class and dfs Chatsiri.rat
*/
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_io.hpp>