Skip to content

Instantly share code, notes, and snippets.

Avatar
Creating Black holes.

Pankaj Doharey metacritical

Creating Black holes.
View GitHub Profile
View *nokogiri-commandline-ref.txt
require 'nokogiri'
require 'open-uri'
# Get a Nokogiri::HTML:Document for the page we're interested in...
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove'))
# Do funky things with it using Nokogiri::XML::Node methods...
####
View react-es6-flow-emacs-configuration.md

Configuring Emacs for react, es6, and flow

For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.

This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.

Set up web-mode

web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.

@metacritical
metacritical / postgres-brew.md
Last active Oct 31, 2020 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)
View postgres-brew.md

Installing Postgres via Brew (Read From below for issues)

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@metacritical
metacritical / cprint.clj
Created Aug 4, 2019 — forked from kocubinski/cprint.clj
ClojureCLR println with colors in Windows cmd.exe
View cprint.clj
(assembly-load "ClojureClrEx")
(ns clync.core
(:use [clojure.clr.pinvoke :only [dllimports]]))
(dllimports
"Kernel32.dll"
(GetStdHandle IntPtr [Int32])
(SetConsoleTextAttribute Boolean [IntPtr UInt32]))
@metacritical
metacritical / handle-escape-opentk.clj
Last active Jul 30, 2019
Inherit GameWindow using proxy and Override OnUpdateFrame method.
View handle-escape-opentk.clj
(ns core
(:gen-class))
(assembly-load-from "./extern/OpenTK/lib/net20/OpenTK.dll")
(import [System]
[System.IO]
[System.Console]
[System.Drawing]
[OpenTK]
@metacritical
metacritical / core-import.clj
Last active Jul 29, 2019
Creating The Game window.
View core-import.clj
(ns core
(:gen-class))
(assembly-load-from "./extern/OpenTK/lib/net20/OpenTK.dll")
(defn -main[]
(Console/WriteLine "Starting OpenTK Window."))
@metacritical
metacritical / core.clj
Last active Jul 29, 2019
Clojure-CLR Hi World!
View core.clj
(ns core
(:gen-class))
(import [System])
(defn -main[]
(System.Console/WriteLine "Hi World"))
@metacritical
metacritical / build.sh
Last active Jul 30, 2019
Clojure-CLR build script for hi world.
View build.sh
#!/usr/local/bin/bash
runtime="mono"
cljcomp=$CLOJURE_LOAD_PATH/Clojure.Compile.exe
compile(){
CLOJURE_COMPILE_PATH=build/ $runtime $cljcomp core
}
link_dlls(){
View BoidBehaviour.cs
using UnityEngine;
public class BoidBehaviour : MonoBehaviour
{
void Update()
{
Boids.Core.update(transform);
}
}
@metacritical
metacritical / Errors
Created Jul 24, 2019
Clojure-1.9.0 Binary Errors with Mono on Mac
View Errors
>> mono all/net40/Clojure.Main.exe
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Clojure.CljMain' threw an exception. ---> System.TypeInitializationException: The type initializer for 'clojure.lang.RT' threw an exception. ---> System.IO.FileNotFoundException: Invalid Image
at (wrapper managed-to-native) System.Reflection.Assembly.LoadFrom(string,bool,System.Threading.StackCrawlMark&)
at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00002] in <f7cedb26ce694cd281e4450870c6fe49>:0
at clojure.lang.RT.DoInit () [0x0000a] in <814990e2d98549148927c9ed5c97f15e>:0
at clojure.lang.RT..cctor () [0x01f89] in <814990e2d98549148927c9ed5c97f15e>:0
--- End of inner exception stack trace ---
at Clojure.CljMain..cctor () [0x0000f] in <f5aa122c398747a0aa41452d219b2965>:0
You can’t perform that action at this time.