Skip to content

Instantly share code, notes, and snippets.

View alx's full-sized avatar
🌌
exploring

Alexandre Girard alx

🌌
exploring
View GitHub Profile
@alx
alx / stratfor_social.gexf
Last active July 3, 2023 20:19
Startfor social network with 167 releases from GIFiles
<?xml version="1.0" encoding="UTF-8"?><gexf xmlns="http://www.gexf.net/1.2draft" version="1.2"><meta lastmodifieddate="2012-02-27"><creator>Tetalab</creator><description>Stratfor</description></meta><graph mode="static" defaultedgetype="directed"><nodes count="702"><node id="mirela.glass" label="mirela.glass"/><node id="hanna" label="hanna"/><node id="glass" label="glass"/><node id="sagebiel" label="sagebiel"/><node id="gibbons" label="gibbons"/><node id="campbell" label="campbell"/><node id="sagebiel" label="sagebiel"/><node id="gibbons" label="gibbons"/><node id="hanna" label="hanna"/><node id="Solomon.Foshko" label="Solomon.Foshko"/><node id="mirela.glass" label="mirela.glass"/><node id="leticia.pursel" label="leticia.pursel"/><node id="undisclosed-recipients:" label="undisclosed-recipients:"/><node id="reva.bhalla" label="reva.bhalla"/><node id="analysts" label="analysts"/><node id="victoria.allen" label="victoria.allen"/><node id="analysts" label="analysts"/><node id="friedman@att.blackberry.net" label="
@alx
alx / openai-gpt2-detector.user.js
Last active April 10, 2023 19:06
Paragraph of text reports the GPT-2 log prob of that text
// ==UserScript==
// @name OpenAI GPT-2 Detector
// @namespace https://www.jolibrain.com/demo/openai-gpt2-detector-userscript
// @description Paragraph of text reports the GPT-2 log prob of that text
// @author Alexandre Girard <alex.girard@jolibrain.com>
// @version 1.2
// @grant none
// @include https://en.wikipedia.org/wiki/*
// ==/UserScript==
#!/bin/bash
adduser webui
apt update && apt install wget git python3 python3-venv ffmpeg libsm6 libxext6 -y
su webui
cd /home/webui/
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui/models/Stable-diffusion
wget https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt
cd ../../
sed -i "s/#export COMMANDLINE_ARGS=\"\"/export COMMANDLINE_ARGS=\"--listen --skip-torch-cuda-test --share\"/g" webui-user.sh
import feedparser
from datetime import datetime, timedelta, timezone
from dateutil import parser
import requests
from bs4 import BeautifulSoup
import re
import urllib.parse
@alx
alx / git.rb
Created December 6, 2010 14:24
Jekyll plugin to add Git activity inside a list
require 'git'
module Jekyll
class GitActivityTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
end
def render(context)
@alx
alx / bot.py
Created September 17, 2019 05:31
Arxiv bot for rocketchat
arxiv
from requests import sessions
from pprint import pprint
from rocketchat_API.rocketchat import RocketChat
import arxiv
import re
regex = r"^https://arxiv\.org\/.*\/(\d+\.\d+(?:v1)?).*$"
login = ""
@alx
alx / webcam_detect.js
Last active June 21, 2018 07:40
Use deepdetect-js to predict detection_600 classes from online webcam images
var fs = require('fs');
var moment = require('moment');
var DD = require('deepdetect-js');
const dd = new DD({
host: 'localhost',
port: 18104,
path: '/api/private/predict'
})
@alx
alx / api.js
Created April 18, 2017 14:45 — forked from fwielstra/api.js
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');

Depends on:

  • Octopress git repo
  • tar
  • rsync
  • rake

Fill in the variables appropriately and copy to hooks/post-receive in your bare git repo

  • git_branch: git branch which holds the source files for the live site
@alx
alx / sigmajs_modularity..js
Created April 8, 2013 15:03
Sigma.js Modularity coloration plugin. Depends on d3js for d3.scale.category20() call.
$(document).ready(function() {
(function(){
var Modularity = function(sig) {
sigma.classes.Cascade.call(this);
var self = this,
domains = [];