Skip to content

Instantly share code, notes, and snippets.

View evanxg852000's full-sized avatar
πŸ’­
Awesomeness πŸ‘Œ

Evance Soumaoro evanxg852000

πŸ’­
Awesomeness πŸ‘Œ
View GitHub Profile
@evanxg852000
evanxg852000 / Program.cs
Created November 20, 2016 13:05
C Sharp hello world
using System;
namespace App {
class Program {
static void Main(string[] args){
Console.Writeline("Hello World!");
}
}
}
@evanxg852000
evanxg852000 / electron-forge-init.sh
Last active June 16, 2017 15:55
Electron forge utility for generating electron project without globally installing electron forge
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Electron forge: please provide the project name".
exit 0
fi
mkdir $1
cd $1
npm init
npm i --save-dev electron-forge
@evanxg852000
evanxg852000 / couch-db-utils-nano
Created June 21, 2017 14:27
Utils to access couchDB using nano
import Promise from 'bluebird'
import nano from 'nano'
import {log} from './utils'
const dbService = 1//nano(process.env.DB_SERVICE_URL)
export const getDbService = () => {
Promise.promisifyAll(dbService.db)
@evanxg852000
evanxg852000 / node_module_loader.js
Created July 31, 2017 18:55
NodeJS module loader
function NativeModule(id) {
this.filename = id + '.js';
this.id = id;
this.exports = {};
this.loaded = false;
}
NativeModule._source = process.binding('natives');
NativeModule._cache = {};
@evanxg852000
evanxg852000 / utc.py
Last active August 3, 2017 12:31
Ultra Tiny Compiler in python
# inspired by https://the-super-tiny-compiler.glitch.me/
'''
(print 12)
(add 2 2)
(subtract 4 2)
(add 2 (subtract 4 2))
'''
import re
import sys
@evanxg852000
evanxg852000 / v8_embedded_demo.cpp
Created August 3, 2017 20:19
Embeding V8 Demo
#include "stdafx.h"
#include <v8.h>
#include <string>
#include <iostream>
#include <fstream>
v8::Handle<v8::ObjectTemplate> global; //global object -> window in our web plannette
v8::HandleScope handle_scope;
v8::Handle<v8::Context> context;
@evanxg852000
evanxg852000 / ImageConvert.py
Last active September 5, 2017 15:27
Convert image to txt file representation
from PIL import Image
def getStr(grayscale):
if (grayscale >= 230.0):
return ' '
if (grayscale >= 200.0):
return '.'
if (grayscale >= 180.0):
return '*'
if (grayscale >= 160.0):
var BTree = function (order) {
this.order = order;
this.values = [];
this.children = [];
};
BTree.prototype.insert = function (value) {
var destination = this.pickChild(value);
if (typeof destination === "number") {
this.insert.call(this.children[destination], value);
set number
colorscheme deus
:set guioptions-=m "remove menu bar
if has("gui_running")
if has("gui_gtk2")
set guifont=Monospace\ 13
elseif has("gui_macvim")
set guifont=Menlo\ Regular:h14