Skip to content

Instantly share code, notes, and snippets.

View ridixcr's full-sized avatar
🎧
Working from home

Pavel ridixcr

🎧
Working from home
View GitHub Profile
@ridixcr
ridixcr / javascript-trim-svg-whitespace.js
Created December 12, 2018 21:44 — forked from john-doherty/javascript-trim-svg-whitespace.js
Trim whitespace from SVG elements
function trimSvgWhitespace() {
// get all SVG objects in the DOM
var svgs = document.getElementsByTagName("svg");
// go through each one and add a viewbox that ensures all children are visible
for (var i=0, l=svgs.length; i<l; i++) {
var svg = svgs[i],
box = svg.getBBox(), // <- get the visual boundary required to view all children
@ridixcr
ridixcr / gist:3075d8e347f0517fbe512ad9cb74537f
Created April 13, 2018 23:56 — forked from gonzalo123/gist:868939
push existing repository to github
cd existing_git_repo
git remote add origin git@github.com:[user]/[reponame].git
git push -u origin master
@ridixcr
ridixcr / IrcSenderSimple.java
Created April 12, 2018 19:54 — forked from kawakami-o3/IrcSenderSimple.java
Simple IRC Client in Java
import java.net.*;
import java.io.*;
import java.util.*;
class IrcSenderSimple {
static void sendString(BufferedWriter bw, String str) {
try {
bw.write(str + "\r\n");
bw.flush();
}
@ridixcr
ridixcr / IRCMessageLoop.java
Created April 12, 2018 19:54 — forked from kaecy/IRCMessageLoop.java
Simple IRC Bot
import java.io.*;
import java.net.*;
import java.util.*;
public abstract class IRCMessageLoop implements Runnable {
Socket server;
OutputStream out;
String theChannel;
IRCMessageLoop(String serverName, int port) {
@ridixcr
ridixcr / base64-utf8.module.js
Created March 18, 2018 16:42 — forked from nijikokun/base64-utf8.module.js
Javascript Base64 UTF8 for the Browser / Server. Base64 UTF-8 Encoding and Decoding Libraries / Modules for AMD, CommonJS, Nodejs and Browsers. Cross-browser compatible.
// UTF8 Module
//
// Cleaner and modularized utf-8 encoding and decoding library for javascript.
//
// copyright: MIT
// author: Nijiko Yonskai, @nijikokun, nijikokun@gmail.com
(function (name, definition, context, dependencies) {
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); }
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); }
else { context[name] = definition.apply(context); }
@ridixcr
ridixcr / CONCURRENCY.md
Created March 16, 2018 10:35 — forked from montanaflynn/CONCURRENCY.md
Examples of sequential, concurrent and parallel requests in node.js

Concurrency in JavaScript

Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.

@ridixcr
ridixcr / irc_games.md
Created January 24, 2018 18:53 — forked from myano/irc_games.md
This is a list of games that are playable on IRC.

List of on-IRC games

AlphaChat

  • #multirpg

BakaShiMoe

@ridixcr
ridixcr / emoji.md
Created December 31, 2017 03:22 — forked from razzul/emoji.md
emoji

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ridixcr
ridixcr / StepsInstallTensorFlow.md
Last active January 24, 2018 14:24 — forked from chakkritte/dp1.txt
Installing TensorFlow

tensorflow/tensorflow#6999

1.Install python https://www.python.org/downloads/release/python-352/

2.To install the CPU-only version of TensorFlow

  • pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl

  • python -m pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl

@ridixcr
ridixcr / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created August 7, 2017 02:45 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \