Skip to content

Instantly share code, notes, and snippets.

@sinfere
sinfere / xhr-ajax-upload-file.js
Last active August 29, 2015 14:00
Simplest ajax upload file
var data = new FormData();
data.append('file', src.files[0]);
$.ajax({
url: url,
type: 'POST',
data: data,
processData: false,
contentType: false,
xhr: function() {
@sinfere
sinfere / jQuery-Firefox-offset-fix
Created July 12, 2014 02:50
jQuery Firefox offsetX offsetY fix
function (e)
{
if (!e.offsetX) {
// FireFox Fix
e.offsetX = e.pageX - $(e.currentTarget).offset().left;
e.offsetY = e.pageY - $(e.currentTarget).offset().top;
}
}
@sinfere
sinfere / sysctl.conf
Last active August 29, 2015 14:16 — forked from kgriffs/sysctl.conf
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# Protection from SYN flood attack.
net.ipv4.tcp_syncookies = 1
#include "MyWidget.h"
#include "ui/UIText.h"
USING_NS_CC;
using namespace std;
using namespace cocos2d::ui;
MyWidget::MyWidget(){}
Widget::ccWidgetTouchCallback MyWidget::onLocateTouchCallback(const string &callBackName)
{
@sinfere
sinfere / file0.txt
Last active August 29, 2015 14:23 — forked from bsmile/file0.txt
[root@zabbix ~]# systemctl start zabbix-server
Job for zabbix-server.service failed. See 'systemctl status zabbix-server.service' and 'journalctl -xn' for details.
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
##### DEBIAN ################
# Debian Experimental
# deb http://ftp.de.debian.org/debian experimental main contrib non-free
# deb-src http://ftp.de.debian.org/debian experimental main contrib
# Debian Sid # CURRENT UNSTABLE
# deb http://ftp.de.debian.org/debian sid main contrib non-free
# deb-src http://ftp.de.debian.org/debian sid main contrib non-free
# Debian 8.0 (Jessie) # CURRENT TESTING
@sinfere
sinfere / ChromePasswords
Created September 20, 2017 02:56 — forked from szabo92/ChromePasswords
Export Google Chrome passwords
# enable import and export
chrome://flags/#password-import-export
# access a menu with the export button
chrome://settings-frame/passwords
@sinfere
sinfere / http-benchmark.md
Created October 4, 2017 14:30 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@sinfere
sinfere / webdriver.sh
Created January 27, 2018 06:39
webdriver.sh
brew tap vulgo/repo
brew install webdriver.sh
sudo webdriver [options]
brew tap vulgo/repo
brew install webdriver.sh
sudo webdriver -cu https://images.nvidia.com/mac/pkg/378/WebDriver-378.10.10.10.25.106.pkg
sudo webdriver -m
/sbin/mount -uw /