Skip to content

Instantly share code, notes, and snippets.

View demidovakatya's full-sized avatar

Katya Demidova demidovakatya

View GitHub Profile
@Alligator
Alligator / really.cs
Created May 27, 2012 11:13 — forked from anonymous/really.cs
really?
if(i==1)
return 4;
if(i==2)
return 4;
if(i==3)
return 4;
if(i==4)
return 4;
if(i==5)
return 4;
/***
Copyright (c) 2016, Alexander Choporov aka CoolCmd
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDE
@artemklevtsov
artemklevtsov / ip-api.R
Last active January 27, 2017 17:52
Геолокация по IP адресу
#' @title Geolocate IP Addresses Through ip-api.com
#' @description
#' \code{geolocate} consumes a vector of IP addresses and geolocates them via
#' \href{http://ip-api.com}{ip-api.com}.
#' @param ip a character vector of IP addresses.
#' @param lang a string to specify an output localisation language.
#' Allowed values: en, de, es, pt-BR, fr, ja, zh-CN, ru.
#' @param fields a string to specify which fields to return.
#' @param delay a logical to whether or not to delay each request by 400ms.
#' ip-api.com has a maximum threshold of 150 requests a minute. Disable it for
import cats.data.StateT
import cats.implicits._
import scala.collection.JavaConverters._
import scala.concurrent.{Await, Future}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import twitter4j._, twitter4j.conf.ConfigurationBuilder
object YourTweetsAreTooLong {
private type PagingState = (Long, Option[Long])
@asmaier
asmaier / start_cloudera.sh
Created July 17, 2017 16:19
Start script for cloudera quickstart docker container (see https://dzone.com/articles/docker-how-to-get-started-with-cloudera)
#!/bin/bash
docker run --name cdh --hostname "quickstart.cloudera" --privileged=true -t -i -d \
-p 80:80 \
-p 7180:7180 \
-p 8888:8888 \
cloudera/quickstart /usr/bin/docker-quickstart
docker exec -ti cdh /home/cloudera/cloudera-manager --express
@erineland
erineland / exportsafarireadinglist.sh
Last active January 19, 2020 00:58
Export Safari's Reading List to Pocket/Evernote (or any service with an "email content in" feature)
#!/bin/bash
# Script to export Safari's reading list into a text file, then import this into Pocket or Evernote (or any service with a "email in content" feature).
# First take all of Safari's Reading List items and place them in a text file.
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' > readinglistlinksfromsafari.txt
# Now loop over each of those URls within that text file and add them to pocket.
while IFS= read -r line
do
echo $line
@fonnesbeck
fonnesbeck / GPTutorial.ipynb
Created April 10, 2012 16:46
An iPython notebook containing a short PyMC tutorial on Gaussian Processes. Requires PyMC and iPython (>=0.12) to be installed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@strizhechenko
strizhechenko / porno.md
Last active June 13, 2023 19:24
Код ниже генерирует прекрасные названия, не знаю для чего, новые жанры порно или названия программных проектов.
#!/usr/bin/env bash

if [ ! -f /tmp/linux ]; then
    curl -sS https://www.linux.org.ru/ | egrep -o /tag/[0-9a-z-]+ | sed 's|/tag/||' > /tmp/linux
fi
if [ ! -f /tmp/pron ]; then
    curl -sS http://www.xvideos.com/tags  | egrep -o /tags/[a-z0-9-]+ | sed 's|/tags/||' > /tmp/pron
fi
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu