This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import time | |
# HTTP | |
import BaseHTTPServer | |
import SimpleHTTPServer | |
import SocketServer | |
import threading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $list_changeResult = $c->db->resultset('ListChange')->create( | |
{ | |
list_id => $list_id, | |
request => [{requester_id => $requester_id, assignee_id => $assignee_id, status => 'new'}], | |
message => { | |
buffer_id => $list_id, | |
user_id => $requester_id, | |
text => "Priority tag '$tag' was removed from the system.", | |
important => 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ImGuiHandler.hpp" | |
#include "imgui/imgui.h" | |
#include <iostream> | |
#include <osgUtil/GLObjectsVisitor> | |
#include <osgUtil/SceneView> | |
#include <osgUtil/UpdateVisitor> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
BEGIN { | |
if ($^O eq "MSWin32") | |
{ | |
require Win32; Win32::->import(); | |
require Win32::API; Win32::API::->import(); | |
require Win32::TieRegistry; Win32::TieRegistry::->import(); | |
} | |
} | |
use List::Util 'first'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import sys | |
ANSI_SEQ = "\x1b[{}m" | |
FG_RGB = "38;2;{};{};{}" | |
BG_RGB = "48;2;{};{};{}" | |
RESET="0" | |
FRAMED="51" | |
ATTRS = {key:code for key, code in [line.strip().split() for line in """\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* An example of serialization. | |
* This example serializes and deserializes only 'x' property. | |
* | |
* vala: 0.36.3 | |
* json-glib: 1.3.2 | |
*/ | |
public class Point : GLib.Object, Json.Serializable { | |
public int x { get; set; } |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define PRINT(...) CAT(CT(__VA_ARGS__))(__VA_ARGS__) | |
#define CAT(N) DOG(N) | |
#define DOG(N) PRINT ## N | |
/* max supported args is 5 for now */ | |
#define CT(...) VALS(__VA_ARGS__, 5, 4, 3, 2, 1) | |
#define VALS(N1, N2, N3, N4, N5, N, ...) N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ "$@" == "" || "$@" == *-h* || "$@" == *--help* ]]; then | |
cat<<EOF | |
tz-windows-to-iana - Convert Windows timezone CLDR to IANA Identifiers. | |
You can acquire Windows timezone CLDR by using the CMD tool \`tzutil\`. | |
There are 2 protocols for identifying timezones. | |
There is the IANA timezone database: https://en.wikipedia.org/wiki/Tz_database | |
There is the Unicode Common Locale Data Repository: http://cldr.unicode.org/ |