Skip to content

Instantly share code, notes, and snippets.

View Makopo's full-sized avatar

Makopoppo Makopo

  • Kanazawa, Ishikawa, Japan
View GitHub Profile
@Makopo
Makopo / v3color.h
Created May 12, 2013 04:18
from /indra/llmath/v3color.h
inline LLColor3::LLColor3(const char* color_string) // takes a string of format "RRGGBB" where RR is hex 00..FF
{
if (strlen(color_string) < 6) /* Flawfinder: ignore */
{
mV[0] = 0.f;
mV[1] = 0.f;
mV[2] = 0.f;
return;
}
@Makopo
Makopo / float_to_rgb.c
Created May 12, 2013 04:29
Modified /indra/llmath/v3color.h color retrieve function (https://gist.github.com/Makopo/5562402) for standalone use. $ ./rgb_to_float 7F194C STRING = 7F194C, R = 0.498039, G = 0.098039, B = 0.298039 $ ./float_to_rgb .5 .1 .3 RGB = 7F194C
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
long red = atof(argv[1])*255.f; // RED
long green = atof(argv[2])*255.f; // GREEN
long blue = atof(argv[3])*255.f; // BLUE
printf("RGB = %02lX%02lX%02lX\n", red, green, blue);
@Makopo
Makopo / Default.sublime-keymap
Last active December 25, 2015 23:09
If you want to change the keymap for lslint, modify your sublime-keymap file like this. This sample code assigns build command to Command + L only when .lsl or .ossl file.
[
// for .lsl files
{
"keys": ["super+l"], // Change here - this is Command + L , for example
"command": "build",
"context":[
{ "key": "selector", "operator": "equal", "operand": "source.lsl" }
]
},
// for .ossl files
$ conda list
# packages in environment at /Users/xxx/.graphlab/anaconda:
#
You are using pip version 7.0.3, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
_license 1.1 py27_0
abstract-rendering 0.5.1 np19py27_0
alabaster 0.7.3 py27_0
anaconda 2.3.0 np19py27_0
appscript 1.0.1 py27_0
@Makopo
Makopo / pom.xml
Last active November 8, 2015 06:44
It creates runnable Java application that has a .dmg extension on osx. For windows, you'll need to change <executable> path and -appclass value.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company</groupId>
<artifactId>Executable</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Create-Executable</name>
example: com.marklogic.client.example.cookbook.ClientCreator
12:40:36.743 [main] DEBUG c.m.client.DatabaseClientFactory - Creating new database client for server at localhost:8000
12:40:36.761 [main] DEBUG c.m.client.impl.JerseyServices - Connecting to localhost at 8000 as rest-writer
12:40:37.061 [main] INFO c.m.client.impl.DocumentManagerImpl - Writing content for /example/text.txt
12:40:37.062 [main] DEBUG c.m.client.impl.JerseyServices - Sending /example/text.txt document in transaction null
Connected to localhost:8000 as rest-writer
12:40:38.023 [main] INFO c.m.client.impl.DocumentManagerImpl - Deleting /example/text.txt
12:40:38.023 [main] DEBUG c.m.client.impl.JerseyServices - Deleting /example/text.txt in transaction null
12:40:38.029 [main] INFO c.m.client.impl.DatabaseClientImpl - Releasing connection
12:40:38.029 [main] DEBUG c.m.client.impl.JerseyServices - Releasing connection
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.lsl</string>
<key>settings</key>
<dict>
<key>icon</key>
<string>file_type_lsl</string>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.ossl</string>
<key>settings</key>
<dict>
<key>icon</key>
<string>file_type_ossl</string>
class View(object):
def show_popup_menu(self, items, on_select, flags = 0):
"""
on_select is called when the the quick panel is finished, and should accept a
single integer, specifying which item was selected, or -1 for none
"""
return sublime_api.view_show_popup_table(self.view_id, items,
on_select, flags, -1)
@Makopo
Makopo / FullTextIndex.java
Created December 19, 2016 13:31
Neo4JのCypherで使えるプロシージャの公式サンプルの日本語訳です。 https://github.com/neo4j-examples/neo4j-procedure-template/blob/3.1/src/main/java/example/FullTextIndex.java
package example;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;