Skip to content

Instantly share code, notes, and snippets.

V Aitvaras DeathBorn

  • Vinted
Block or report user

Report or block DeathBorn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@DeathBorn
DeathBorn / apple script
Created Jul 21, 2019
safari passwords to text editor
View apple script
repeat 10 times
tell application "Safari"
activate
delay 0.4
tell application "System Events" to set frontApp to name of first process whose frontmost is true
tell application "System Events"
tell application process frontApp
set _selection to value of attribute "AXFocusedUIElement"
tell _selection to perform action "AXShowMenu"
tell application "System Events" to key code 125
View gist:d89cf2e39e6b14cd19ca35373c53aa05
// a list of useful queries for profiler analysis. Starting with the most basic.
// 2.4 compatible
//
// output explained:
//
{
"ts" : ISODate("2012-09-14T16:34:00.010Z"), // date it occurred
"op" : "query", // the operation type
"ns" : "game.players", // the db and collection
@DeathBorn
DeathBorn / check_zookeeper.sh
Created Jul 17, 2017 — forked from hcoyote/check_zookeeper.sh
Get a healthcheck on zookeeper. must be a version that responds to ruok.
View check_zookeeper.sh
#!/bin/sh
HOST=$1
PORT=$2
TIMEOUT=5
if [ ! -x /usr/bin/nc ] ; then
echo "/usr/bin/nc is missing; required for $0 to run"
exit 3
@DeathBorn
DeathBorn / gist:d789fef416a417122646f71229a91f1c
Created Jun 3, 2016 — forked from ttezel/gist:4138642
Natural Language Processing Notes
View gist:d789fef416a417122646f71229a91f1c

#A Collection of NLP notes

##N-grams

###Calculating unigram probabilities:

P( wi ) = count ( wi ) ) / count ( total number of words )

In english..

@DeathBorn
DeathBorn / urls.py
Last active Aug 29, 2015
Generating pdfs with Django and Latex
View urls.py
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(r'^entry/(?P<pk>\d+)\.pdf$', views.entry_as_pdf, name='entry_pdf'),
)
View app.js
var express = require('express'),
passport = require('passport'),
GoogleStrategy = require('passport-google').Strategy,
connect = require('express/node_modules/connect'),
http = require('http'),
path = require('path'),
util = require('util'),
fs = require('fs'),
redis = require('redis'),
cookie = require('cookie'),
View Sharded mongodb environment on localhost
# clean everything up
echo "killing mongod and mongos"
killall mongod
killall mongos
echo "removing data files"
rm -rf data/config
rm -rf data/shard*
# For mac make sure rlimits are high enough to open all necessary connections
ulimit -n 2048
View gist:2a684cf1f535683d07da

Fix locale problem

Run the following command

$ update-locale LC_ALL="en_US.UTF-8"

If it failed, you will need to add the following to /var/lib/locales/supported.d/local file

en_US.UTF-8 UTF-8
View unicode_to_latex.py
# original XML at http://www.w3.org/Math/characters/unicode.xml
# XSL for conversion: https://gist.github.com/798546
unicode_to_latex = {
u"\u0020": "\\space ",
u"\u0023": "\\#",
u"\u0024": "\\textdollar ",
u"\u0025": "\\%",
u"\u0026": "\\&amp;",
View urbanspoon_reservations.rb
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
You can’t perform that action at this time.