Skip to content

Instantly share code, notes, and snippets.

View codxse's full-sized avatar
🐲
Shenlong

Nadiar AS codxse

🐲
Shenlong
View GitHub Profile
@codxse
codxse / gist:cf6ab4fd1391d105513cc5d03cdd8d75
Created February 2, 2019 09:14 — forked from mwolff44/gist:abfc7848e5cfa35b8c6a
remove jetpack unwanted css - Wordpress
<?php
/*
MU Plugin: remove-jetpack-css
Plugin Name: WP Remove Jetpack CSS
Plugin URI: http://www.blog-des-telecoms.com
Description: Remove jetpack CSS
Version: 1.0
Author: Mathias WOLFF
Author URI: http://www.mathias-wolff.fr
License: GPLv3
@codxse
codxse / build.clj
Created November 11, 2018 04:04 — forked from souenzzo/build.clj
Using material-ui.com from cljs. Still a fat build
;; this can be used on figwheel or in "any" cljs build api
;; at the first time, create a empty package.json with `{}` inside and `yarn add react webpack webpack-cli react-dom @material-ui/core`
;; you need to run "yarn install" and "yarn webpack" BEFORE this
;; !!!! this is a dev build !!!!
(def dev-build
'{:id "dev"
:source-paths ["src" "dev"]
:figwheel {:on-jsload cljs.user/on-jsload}
:compiler {:main cljs.user
:asset-path "/js/out"
@codxse
codxse / generate-pushid.js
Created November 3, 2018 05:33 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@codxse
codxse / promise.cljc
Last active August 21, 2018 18:22 — forked from lilactown/promise.cljc
A simple macro to aid with dealing with promise chains in ClojureScript
(ns lilactown.promise)
;; This is a simple macro to aid with dealing with promise chains
;; in ClojureScript. Often external JS libraries (such as request-promise
;; or other async libs) return a promise object, so we write code like:
;;
;; (-> promise-value
;; (.then do-something)
;; (.then #(do-something-else %))
;; (.then (fn [val] (and-again val)))
@codxse
codxse / nginx.conf
Last active August 13, 2018 17:02 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@codxse
codxse / om.next+pedestal+transit.clj
Created September 9, 2017 11:35 — forked from rauhs/om.next+pedestal+transit.clj
Om.next tempid handling for pedestal. Interceptors.
(ns srs-s.routes.core
(:require [io.pedestal.http :as pedestal]
[io.pedestal.http.route.definition :refer [defroutes]]
[io.pedestal.interceptor.helpers :as interceptor]
[io.pedestal.http.body-params :as body-params]
[ring.util.response :as ring-response]
[cognitect.transit :as transit]
[om.next.server :as om]
[om.tempid :as tempid])
(:import [java.io OutputStream]
@codxse
codxse / om-next-bootstrap.sh
Created September 9, 2017 06:33 — forked from anmonteiro/om-next-bootstrap.sh
Use Om Next from Planck.
#!/bin/bash
set -e
if [ ! -d "om" ]; then
git clone -b self-host --depth=1 https://github.com/anmonteiro/om.git
fi
if [ ! -e "om/react-dom-server.jar" ]; then
curl -s -L https://clojars.org/repo/cljsjs/react-dom-server/15.3.0-0/react-dom-server-15.3.0-0.jar -o om/react-dom-server.jar
@codxse
codxse / outline.clj
Created May 15, 2017 12:54 — forked from terjesb/outline.clj
Hierarchies in Datomic
(use 'datomic.samples.repl)
(easy!)
(def conn (scratch-conn))
(transact-all conn (io/resource "day-of-datomic/outline.dtm"))
(def rules
'[[(ancestors ?section ?ancestor) [?section :section/parent ?ancestor]]
[(ancestors ?section ?ancestor) [?section :section/parent ?parent]
(ancestors ?parent ?ancestor)]
@codxse
codxse / friendscluster.R
Created July 18, 2016 15:13 — forked from jean-robert/friendscluster.R
Cluster your Facebook friends
require(igraph)
require(RCurl)
require(rjson)
# Insert your own token
access_token <- '****'
# Romain François's function to connect to Facebook Graph API
facebook <- function( path = "me", access_token = token, options) {
if( !missing(options) ){
@codxse
codxse / install-comodo-ssl-cert-for-nginx.rst
Created April 18, 2016 07:20 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert