Skip to content

Instantly share code, notes, and snippets.

Ilgrim Ilgrim

Block or report user

Report or block Ilgrim

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
@Ilgrim
Ilgrim / plugins.md
Created Sep 5, 2019 — forked from manasthakur/plugins.md
Managing plugins in Vim
View plugins.md

Managing plugins in Vim: The basics

Let's say the plugin is at a GitHub URL https://github.com/manasthakur/foo. First get the plugin by either cloning it (git clone https://github.com/manasthakur.foo.git) or simply downloading it as a zip (from its GitHub page).

Adding a plugin in Vim is equivalent to adding the plugin's code properly into its runtimepath (includes the $HOME/.vim directory by default). For example, if the layout of a plugin foo is as follows:

foo/autoload/foo.vim
foo/plugin/foo.vim
View gist:a1bd343fcd4b9b57c8dfe6e0b8f2c3f9
AVFormatContext *formatC = avformat_alloc_context();
AVDictionary* options = NULL;
av_dict_set(&options,"list_devices","true",0);
AVInputFormat *iformat = av_find_input_format("dshow");
avformat_open_input(&formatC,"video=dummy",iformat,&options);
@Ilgrim
Ilgrim / .htaccess
Created Jul 24, 2019 — forked from Guibzs/.htaccess
Symfony 4 ~ .htaccess
View .htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
View vimrc
source ~/dotfiles/vim/bundle/pathogen.vim
call pathogen#infect('~/dotfiles/vim/bundle')
call pathogen#helptags()
" To use this file, source it in your own personal .vimrc file (``source
" <filename>``) or, if you don't have a .vimrc file, you can just symlink to it
" (``ln -s <this file> ~/.vimrc``). All options are protected by autocmds
" (read below for an explanation of the command) so blind sourcing of this file
@Ilgrim
Ilgrim / ctags_autocmd.vim
Created Jul 18, 2019 — forked from rafeco/ctags_autocmd.vim
My Vim ctags configuration
View ctags_autocmd.vim
function! DelTagOfFile(file)
let fullpath = a:file
let cwd = getcwd()
let tagfilename = cwd . "/tags"
let f = substitute(fullpath, cwd . "/", "", "")
let f = escape(f, './')
let cmd = 'sed -i "/' . f . '/d" "' . tagfilename . '"'
let resp = system(cmd)
endfunction
@Ilgrim
Ilgrim / test.sh
Created Jul 15, 2019 — forked from arq5x/test.sh
Compress and then Decompress a string with zlib.
View test.sh
# compile
$ g++ zlib-example.cpp -lz -o zlib-example
# run
$ ./zlib-example
Uncompressed size is: 36
Uncompressed string is: Hello Hello Hello Hello Hello Hello!
----------
@Ilgrim
Ilgrim / index.py
Created Jul 1, 2019 — forked from FaztTech/index.py
Python Simple Discord Bot
View index.py
import discord
from discord.ext import commands
import datetime
from urllib import parse, request
import re
bot = commands.Bot(command_prefix='>', description="This is a Helper Bot")
@bot.command()
@Ilgrim
Ilgrim / client.js
Created Jun 17, 2019 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
View client.js
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@Ilgrim
Ilgrim / multihooks.py
Created Jun 13, 2019 — forked from carlos-jenkins/multihooks.py
Delegating script for multiple git hooks
View multihooks.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2017 Carlos Jenkins <carlos@jenkins.co.cr>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
View __init__.py
default_app_config = 'cn.apps.users.config.UsersAppConfig'
You can’t perform that action at this time.