Skip to content

Instantly share code, notes, and snippets.

View noosxe's full-sized avatar

Levon Kirakosyan noosxe

View GitHub Profile
@noosxe
noosxe / iterm2.json
Created April 21, 2020 23:27
Iterm2 configuration
{
"Ansi 4 Color" : {
"Red Component" : 0.37254902720451355,
"Color Space" : "sRGB",
"Blue Component" : 0.61568629741668701,
"Alpha Component" : 1,
"Green Component" : 0.5058823823928833
},
"Tags" : [
@noosxe
noosxe / jupyterhub.conf
Created March 22, 2020 21:03
nginx config for running jupyterhub behind a reverse proxy
server {
listen 80;
server_name subdomain.example.com;
location / {
proxy_pass http://localhost:1600;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
#!/usr/bin/env bash
# adds a user non-interactively
adduser --disabled-password --gecos "" $1
@noosxe
noosxe / uri_components_parser.js
Last active August 29, 2015 14:09
(/id/slug)+ style URI components parser
/**
* Breaks given uri into 'id' and 'slug' components
* Just provide it uri like /id1/slug1/id2/slug2...
*
* @param {string} uri to break into components
* @return {object} returns an object consisting of 'id' and 'slug' arrays
*/
function getURIComponents(uri) {
var pattern = /\/(?:([a-z][a-z0-9_-]+)|(?:(\d+)\/([a-z][a-z0-9_-]+)))/ig;
var components = { separators: [], groups: [], count: 0 };
@noosxe
noosxe / test.cs
Created April 12, 2014 08:52
Unity3D C# test for internet connection
// Unity3D C# test for internet connection
IEnumerator CheckConnection()
{
const float timeout = 10f;
float startTime = Time.timeSinceLevelLoad;
var ping = new Ping("8.8.8.8");
while (true)
{
dpkg-query -l 'lib*-perl' | awk '{{print $2}}' | tr "\n" " " > perl_packages.list
@noosxe
noosxe / .gitignore
Last active August 29, 2015 13:57
Sequelize issue #1414 test case
node_modules/