Skip to content

Instantly share code, notes, and snippets.

View neugen86's full-sized avatar

Eugeny Neustroev neugen86

View GitHub Profile
@vshvedov
vshvedov / gist:1370650
Created November 16, 2011 17:00
Sublime Text Edit 2 for Debian (from PPA)
wget http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt
sudo mv add-apt-repository.sh.txt /usr/sbin/add-apt-repository
sudo chmod o+x /usr/sbin/add-apt-repository
sudo chown root:root /usr/sbin/add-apt-repository
sudo add-apt-repository ppa:webupd8team/sublime-text-2
@kovrov
kovrov / SwipeArea.qml
Last active August 16, 2023 14:50
Swipe
/* This code was written by Sergejs Kovrovs and has been placed in the public domain. */
import QtQuick 2.0
MouseArea {
property point origin
property bool ready: false
signal move(int x, int y)
signal swipe(string direction)
@obscurerichard
obscurerichard / README.md
Created September 17, 2012 22:35
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.

@maccam912
maccam912 / sudoku.cpp
Created December 10, 2012 04:53
Solution to HackerRank Olympics sudoku puzzle in C++
#include<iostream>
#include<vector>
#include<set>
#include<math.h>
using namespace std;
int getSector(int row, int col) {
return (row/3)*3+(col/3);
}
@alex-sherwin
alex-sherwin / gist:9642535
Created March 19, 2014 14:18
IntelliJ IDEA .vmoptions
-ea
-server
-Xms394m
-Xmx1024m
-Xss16m
-XX:PermSize=350m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=256m
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
@andrejbauer
andrejbauer / topology.v
Last active November 28, 2023 19:40
How to get started with point-set topology in Coq. This is not actually how one would do it, but it is an intuitive setup for a classical mathematician.
(* How do to topology in Coq if you are secretly an HOL fan.
We will not use type classes or canonical structures because they
count as "advanced" technology. But we will use notations.
*)
(* We think of subsets as propositional functions.
Thus, if [A] is a type [x : A] and [U] is a subset of [A],
[U x] means "[x] is an element of [U]".
*)
Definition P (A : Type) := A -> Prop.
@nitaku
nitaku / README.md
Last active July 3, 2024 19:37
Minimal JSON HTTP server in python

A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.

python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
@trusktr
trusktr / DefaultKeyBinding.dict
Last active June 26, 2024 10:06
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@m-ou-se
m-ou-se / clock.scad
Last active December 11, 2016 12:48
3D model for my whiteboard clock
$fs=1;
$fa=1;
servo_l = 24;
servo_w = 13;
servo_h = 21;
bolt_hole_diameter = 4.5;
servo_axis_diameter = 4;
@Nimrodda
Nimrodda / Android.mk
Created March 5, 2015 14:36
Sample Android.mk with prebuilt static library
LOCAL_PATH := $(call my-dir)
# hatch library
include $(CLEAR_VARS)
LOCAL_MODULE := prebuilt-static-lib
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libprebuilt-static-lib.a
# The header files should be located in the following dir relative to jni/ dir
LOCAL_EXPORT_C_INCLUDES := include/
include $(PREBUILT_STATIC_LIBRARY)