Skip to content

Instantly share code, notes, and snippets.

@shajeen
shajeen / [python] clone all star repo
Last active March 8, 2024 09:20
Code to download all stared repo
from github import Github
from pygit2 import clone_repository
import random
import string
import json
import os
path = "/home/shajeen/Documents/git_stared/"
g = Github("git personal access token")
@echo off
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
@rem *** Disable Some Service ***
sc stop DiagTrack
sc stop diagnosticshub.standardcollector.service
sc stop dmwappushservice
sc stop WMPNetworkSvc
sc stop WSearch
@c-cube
c-cube / gen_expr.ml
Last active August 3, 2016 16:11
generate all possible expressions from a list of basic values
(* ocamlfind opt -package sequence,benchmark -linkpkg truc.ml -o truc; ./truc*)
open Sequence.Infix
type op =
| Add
| Mult
| Div
| Minus
@akorotkov
akorotkov / pg_graph
Created June 5, 2016 10:21
Draw psql output as iTerm2 v3 inline graph using matplotlib
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Draw psql output as iTerm2 v3 inline graph using matplotlib
# Author: Alexander Korotkov <a.korotkov@postgrespro.ru>
import sys
import re
import warnings
import matplotlib
matplotlib.use("Agg")
@LiSongMWO
LiSongMWO / Lists.java
Created May 5, 2016 19:23
Performance benchmark Java LinkedList vs ArrayList appending.
package perf;
import java.util.ArrayList;
import java.util.LinkedList;
import net.tuis.ubench.UBench;
public class Lists {
public static void main(String[] args) throws Exception {
final UBench bench = new UBench("ArrayList VS LinkedList");
@stuart-marks
stuart-marks / SequenceTests.java
Last active March 8, 2021 21:25
Ken Fogel's collections benchmarks rewritten in JMH
package com.kenfogel.performance.loaders;
import java.util.*;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.*;
/**
* Performs a set of tests to determine the Big-O performance of an array list, array deque,
* and linked list.
*
@eric-pommereau
eric-pommereau / gist:4a5966cffa3a71867210
Last active January 20, 2019 13:52
Import opendata ANFR
/*
Exemple de réutilisation opendata
_ _ _ ___ ___
/_\ | \| | __| _ \
/ _ \| .` | _|| /
/_/ \_\_|\_|_| |_|_\
Description : installations radioélectriques de plus de 5 watts, hormis celles de l'Aviation Civile et des ministères de la Défense et de l'Intérieur.
import java.io.*;
import java.util.regex.*;
public class AS32J {
static public String getContents(File file) {
StringBuffer contents = new StringBuffer();
try {
BufferedReader input = new BufferedReader(new FileReader(file));
try {
String line = null;